# Review Calls

> Batch reviews a client's recent AI-handled calls and onboarding meetings. Uses Attention for Ivan's recorded calls, Supabase for Avoca call data, and VAPI API for transcript/tool-call deep dives on a sample. Outputs a performance summary and saves a report to the client's logs/ folder. Use when the user says "review calls {client}", "call review {client}", or "how are calls going for {client}".

- Skill: `ivangit-avoca/review-calls` (Agent Skill)
- Install (CLI): `npx skillmds@latest add ivangit-avoca/review-calls`
- Raw SKILL.md: https://api.skillmd.com/api/skills/ivangit-avoca/review-calls/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Docs & Writing
- Author: ivangit-avoca (https://skillmd.com/u/ivangit-avoca)
- Updated: 2026-09-22
- Page: https://skillmd.com/skills/ivangit-avoca/review-calls

---


# Review Calls

## When this applies

- User says **"review calls {client}"**, **"call review {client}"**, or **"how are calls going for {client}"**
- User wants a high-level audit of a client's recent AI call performance
- User wants to see onboarding call history alongside live call metrics

**Not the same as `avoca-vapi-call-resolve`** — that skill resolves specific call IDs for debugging. This skill is a higher-level review/audit across recent calls.

## Prerequisites

- `avoca-client.json` must exist with a non-empty `avoca_client_id`
- `context.md` should have the company name in the heading

## MCP servers and tools

1. **Attention** (`user-attention`): `search_calls`, `ask_attention`, `get_call_details`
2. **Supabase** (`user-Supabase`): `execute_sql` — project_id `wmizcewjcybhvkpwpmim`
3. **VAPI API** (`user-vapi-api`): `get_call` — for transcript and tool-call traces on sampled calls

## Workflow

### Step 1 — Resolve client

1. Match the client to their `clients/{Name}-{ID}/` folder.
2. Read `avoca-client.json` — extract `avoca_client_id` (this is the team_id for Supabase).
3. Read `context.md` — extract company name from the `# {Name} — {ID}` heading.
4. If no `avoca_client_id`, stop and tell the user the health check can't run without a team ID.

### Step 2 — Search Attention (onboarding calls)

Search for Ivan's recorded onboarding/testing/go-live calls with the client.

- **Tool:** `search_calls`
- **Args:** `title: "{company name}"`, `from_date: 30 days ago (ISO 8601)`, `size: 25`

These are Ivan's Zoom/Meet calls — kickoffs, testing sessions, go-lives.

### Step 3 — Batch analyze onboarding calls

If Attention returned call IDs, run `ask_attention` with all IDs and this prompt:

> "For each call: summarize key decisions, action items, and any unresolved blockers. Note whether each is a kickoff, testing, go-live, or follow-up call."

This returns a single AI-generated analysis across all calls — much faster than calling `get_call_details` in a loop.

If Attention returned no calls or is unavailable, skip this step.

### Step 4 — Query Avoca calls (AI-handled)

Run against Supabase to get the client's recent AI-handled calls:

```sql
SELECT
  id,
  vapi_call_id,
  ai_or_human,
  status,
  created_at,
  duration_seconds,
  customer_phone,
  call_reason,
  summary,
  emergency
FROM public.calls
WHERE team_id = {team_id}
  AND created_at > NOW() - INTERVAL '14 days'
ORDER BY created_at DESC
LIMIT 50;
```

From the results, compute:
- **Total calls** in the period
- **AI-handled** count and percentage
- **Outcome breakdown**: count calls by `status` (booked, message_taken, transferred, etc.)
- **Average duration** (from `duration_seconds`)
- **Emergency flagged** count

### Step 5 — Sample deep dive (VAPI transcripts)

Pick up to **5 representative calls** from the Supabase results that have a `vapi_call_id`. Prioritize:
1. Calls with unusual outcomes (transferred, failed, emergency)
2. Short-duration calls (possible hang-ups or errors)
3. Recent calls (most relevant to current state)

For each sampled call, use VAPI API `get_call` with `callId` set to the `vapi_call_id`. Extract:
- Full transcript (formatted as dialogue with speaker labels)
- Tool calls: which tools were called, whether they succeeded or failed
- End reason
- Cost

Assess each sampled call for:
- **Booking success**: Did the bot complete the booking flow?
- **Tool failures**: Did `findCustomerDNS`, `getBookingInformationByStAtAdd`, or other tools error?
- **Flow correctness**: Did the bot follow the expected module sequence?
- **Customer experience**: Any awkward loops, repeated questions, or confusion?

### Step 6 — Generate report

Save to: `clients/{Name}-{ID}/logs/{YYYY-MM-DD}-call-review.md`

If a file with that name exists, append a disambiguator (e.g., `-2`).

```markdown
# {Client Name} — Call Review ({start date} to {end date})

**Team ID:** {team_id}
**Generated:** {timestamp}

---

## Onboarding calls (Attention)

| Date | Call title | Type | Key outcomes | Open items |
|------|-----------|------|--------------|------------|
| 4/10 | Sykes Go-Live | Go-live | Went live, first call booked in 1hr | ZIP 20743 missing, fee mapping |

{ask_attention analysis summary — key decisions and unresolved items across all calls}

---

## AI call performance (last 14 days)

| Metric | Value |
|--------|-------|
| Total calls | {n} |
| AI-handled | {n} ({%}) |
| Booked | {n} |
| Message taken | {n} |
| Transferred | {n} |
| Other | {n} |
| Avg duration | {n}s |
| Emergency flagged | {n} |

---

## Sample call analysis

### Call 1 — {short summary}

- **Avoca ID:** `{id}`
- **VAPI ID:** `{vapi_call_id}`
- **Time:** {created_at}
- **Duration:** {duration}s
- **Outcome:** {booked / transferred / message_taken}
- **End reason:** {endedReason}

**Tool calls:**

| Tool | Result | Notes |
|------|--------|-------|
| findCustomerDNS | ✅ Success | Found existing customer |
| getBookingInformationByStAtAdd | ❌ Failed | Timeout on first attempt, succeeded on retry |

**Issues:** {any problems observed}

**Transcript excerpt:**
> (include only the key exchange — 5-10 turns max, not the full transcript)

---

{repeat for each sampled call}

## Patterns & recommendations

- {Pattern 1: e.g., "3 of 5 sampled calls had tool retry on getBookingInformationByStAtAdd — may indicate slow ST API response times"}
- {Pattern 2: e.g., "Bot asked for equipment age on a plumbing call — HVAC-only question leaking into other trades"}
- {Recommendation: e.g., "Consider adding ZIP 20743 to service areas — 2 calls transferred unnecessarily"}
```

### Step 7 — Chat summary

Show a concise version in chat (not the full report):

> Reviewed **{Client Name}** calls — {n} AI calls in the last 14 days ({booking_rate}% booked).
> Sampled {n} calls: {brief findings}.
> Full report: `clients/{Name}-{ID}/logs/{date}-call-review.md`

## Customization

The user can specify:
- **Date range**: "review calls for OHA last 7 days" → adjust the SQL `INTERVAL` and Attention `from_date`
- **Sample size**: "review calls for OHA, check 10 calls" → increase the VAPI sample
- **Focus area**: "review calls for OHA, focus on transfers" → filter Supabase results to transferred calls and prioritize those for sampling

## Error handling

- If Attention MCP is unavailable, skip onboarding calls section and note it.
- If Supabase returns no calls, report "No AI calls found in the last 14 days" and skip the sample analysis.
- If VAPI `get_call` fails for a sampled call, note the failure and continue with remaining samples.
- Never block the report because one source failed — output whatever data is available.

## Safety

- Read-only: never write to Supabase or VAPI.
- Only interpolate validated team IDs into SQL — no arbitrary user input in queries.
- Large transcripts: truncate to key exchanges in the report, not full dumps.

