get_call_events
Retrieve millisecond-precision call event logs to debug call flow issues and diagnose communication problems.
Instructions
Get the detailed event log for a call with millisecond-precision timestamps. Useful for debugging call flow issues.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| call_id | Yes | The call ID |
Implementation Reference
- src/tools/calls.ts:156-157 (handler)The handler function for get_call_events tool. It receives params with call_id and makes an API GET request to /calls/{call_id}/events via the client.
async (params) => callTool(() => client.get(`/calls/${params.call_id}/events`)) ); - src/tools/calls.ts:147-157 (registration)Registration of the get_call_events tool with name, description, input schema (call_id string), and annotations (read-only, non-destructive, idempotent).
server.registerTool( "get_call_events", { description: "Get the detailed event log for a call with millisecond-precision timestamps. Useful for debugging call flow issues.", inputSchema: { call_id: z.string().describe("The call ID"), }, annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false }, }, async (params) => callTool(() => client.get(`/calls/${params.call_id}/events`)) ); - src/tools/calls.ts:13-20 (helper)The callTool helper that wraps API calls with try/catch error handling. On success returns toolResult with JSON data, on failure returns toolError with API error details.
async function callTool<T>(fn: () => Promise<T>) { try { return toolResult(await fn()); } catch (err) { const apiErr = err as ApiError; return toolError(`API error (${apiErr.status}): ${apiErr.message}`); } } - src/tools/calls.ts:5-11 (helper)Helper functions toolError and toolResult that format tool responses with content array for MCP protocol.
function toolError(message: string) { return { content: [{ type: "text" as const, text: message }], isError: true }; } function toolResult(data: unknown) { return { content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }] }; }