start_call
Initiate phone calls through Voyp API to handle tasks like appointment scheduling or order processing, with real-time progress tracking available via returned URL.
Instructions
Start a new phone call via Voyp API. The API returns the call id and a URL where users can track the progress of the call
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| number | Yes | Phone number to call in E.164 format | |
| language | No | Language of the call. Ex: en-US, pt-PT, fr-FR | |
| context | Yes | Context of the call. Ex: Order a pizza |
Implementation Reference
- src/index.ts:349-386 (handler)Handler for the 'start_call' tool within the CallToolRequestSchema. Extracts number, context, and optional language from arguments, makes a POST request to the Voyp API /call/start endpoint, and returns the response data as JSON text content.} else if (request.params.name === "start_call") { // if (!isValidForecastArgs(request.params.arguments)) { // throw new McpError( // ErrorCode.InvalidParams, // "Invalid forecast arguments" // ); // } const number = request.params.arguments?.number; const context = request.params.arguments?.context; const language = request.params.arguments?.language; try { const response = await this.axiosInstance.post<StartCallResponse>(API_CONFIG.ENDPOINTS.START, { number, context, language }); return { content: [{ type: "text", text: JSON.stringify(response.data) }] }; } catch (error) { if (axios.isAxiosError(error)) { return { content: [{ type: "text", text: `Voyp API error: ${error.response?.data.message ?? error.message}` }], isError: true, } } throw error; }
- src/index.ts:208-228 (registration)Registration of the 'start_call' tool in the ListToolsRequestSchema handler, including name, description, and input schema definition.name: "start_call", description: "Start a new phone call via Voyp API. The API returns the call id and a URL where users can track the progress of the call", inputSchema: { type: "object", properties: { number: { type: "string", description: "Phone number to call in E.164 format" }, language: { type: "string", description: "Language of the call. Ex: en-US, pt-PT, fr-FR" }, context: { type: "string", description: "Context of the call. Ex: Order a pizza" } }, required: ["number", "context"] } },
- src/types.ts:1-5 (schema)TypeScript interface for the StartCallResponse returned by the Voyp API, used in the handler's axios POST call.export interface StartCallResponse { id?: string; url?: string; error?: string }
- src/types.ts:11-14 (schema)TypeScript interface matching the request body structure for starting a call, aligning with the tool's input schema.export interface StartCallRequest { number: string; context: string; }