UNPKG

@callzero/mcp

Version:

MCP server for CallZero AI phone call automation

53 lines (52 loc) 1.65 kB
import { ShareCallInputSchema } from "../schemas.js"; export function createShareCallTool(client) { return { name: "share_call", description: "Generate a shareable link for a call transcript that others can view without authentication.", inputSchema: { type: "object", properties: { callId: { type: "string", description: "ID of the call to share", }, expiresInDays: { type: "number", minimum: 1, maximum: 30, description: "Number of days before the share link expires (default: 7)", }, }, required: ["callId"], }, }; } export async function handleShareCall(client, args) { try { // Validate input const validatedInput = ShareCallInputSchema.parse(args); // Call HTTP API const result = await client.shareCall(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 share call: ${errorMessage}`, }, null, 2), }, ], }; } }