Skip to content

feat: add get_call_details tool#17

Open
nickrobin wants to merge 1 commit intomainfrom
add-get-call-details
Open

feat: add get_call_details tool#17
nickrobin wants to merge 1 commit intomainfrom
add-get-call-details

Conversation

@nickrobin
Copy link
Copy Markdown

Summary

The existing get_call tool returns a summary projection (id, status, endedReason, assistantId, phoneNumberId, customer.number, scheduledAt) — there's no way to fetch transcripts, recordings, messages, costs, or analysis through MCP without dropping out to the REST API.

This adds a sibling get_call_details tool that returns the full call payload. It accepts an optional include array so callers can scope the response to specific fields and keep LLM context windows manageable on long calls.

Changes

  • New schemas in src/schemas/index.ts:
    • GetCallDetailsInputSchema (callId + optional include)
    • CallDetailsOutputSchema (extends CallOutputSchema)
    • CALL_DETAIL_FIELDS constant
  • New transformer transformCallDetailsOutput in src/transformers/index.ts — falls back to call.artifact[field] when the field isn't on the top-level call object
  • New tool registration get_call_details in src/tools/call.ts, paired with the existing get_call
  • E2E test updated to assert the tool is registered

Test plan

  • npm run build passes
  • tsc --noEmit clean
  • Manually verify against a real call ID via the MCP inspector
  • include: ['transcript'] returns just { id, transcript }
  • No include returns the full summary + all detail fields

The existing get_call tool returns a summary projection (id, status,
endedReason, assistantId, phoneNumberId, customer.number, scheduledAt)
which makes it impossible to fetch transcripts, recordings, messages,
costs, or analysis without dropping out to the REST API.

This adds a sibling get_call_details tool that returns the full call
payload. It accepts an optional 'include' array so callers can scope
the response to specific fields (transcript, recordingUrl, messages,
costs, cost, analysis, summary, artifact) and keep LLM context windows
in check on long calls.

- New schemas: GetCallDetailsInputSchema, CallDetailsOutputSchema, CALL_DETAIL_FIELDS
- New transformer: transformCallDetailsOutput
- New tool registration in src/tools/call.ts
- E2E test updated to assert tool is registered
@nickrobin nickrobin requested review from ramsrib and stevenbdf May 7, 2026 23:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant