UNPKG

@callzero/mcp

Version:

MCP server for CallZero AI phone call automation

47 lines (46 loc) 1.42 kB
import { GetCallStatusInputSchema } from "../schemas.js"; export function createGetCallStatusTool(client) { return { name: "get_call_status", description: "Get the current status and basic information of a phone call by its ID.", inputSchema: { type: "object", properties: { callId: { type: "string", description: "ID of the call to get status for", }, }, required: ["callId"], }, }; } export async function handleGetCallStatus(client, args) { try { // Validate input const validatedInput = GetCallStatusInputSchema.parse(args); // Call HTTP API const result = await client.getCallStatus(validatedInput); return { content: [ { type: "text", text: JSON.stringify(result, null, 2), }, ], }; } catch (error) { const errorMessage = error instanceof Error ? error.message : "Unknown error occurred"; return { content: [ { type: "text", text: JSON.stringify({ error: `Failed to get call status: ${errorMessage}`, }, null, 2), }, ], }; } }