list_tools
Discover available Vapi API tools to integrate with AI models through the Model Context Protocol, enabling access to Vapi's capabilities.
Instructions
Lists all Vapi tools
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/tool.ts:16-19 (handler)Core handler logic for list_tools: fetches Vapi tools list (limit 10) and transforms each using transformToolOutput.createToolHandler(async () => { const tools = await vapiClient.tools.list({ limit: 10 }); return tools.map(transformToolOutput); })
- src/tools/tool.ts:12-20 (registration)Registers the 'list_tools' tool on the MCP server with empty input schema and the core handler.server.tool( 'list_tools', 'Lists all Vapi tools', {}, createToolHandler(async () => { const tools = await vapiClient.tools.list({ limit: 10 }); return tools.map(transformToolOutput); }) );
- src/schemas/index.ts:410-418 (schema)Defines the ToolOutputSchema used for transforming and validating individual tool outputs from Vapi.export const ToolOutputSchema = BaseResponseSchema.extend({ type: z .string() .describe('Type of the tool (dtmf, function, mcp, query, etc.)'), name: z.string().describe('Name of the tool'), description: z.string().describe('Description of the tool'), parameters: z.record(z.any()).describe('Parameters of the tool'), server: ServerSchema.describe('Server of the tool'), });
- src/tools/utils.ts:30-41 (helper)createToolHandler utility wraps the raw handler function with error handling and standard ToolResponse formatting.export function createToolHandler<T>( handler: (params: T) => Promise<any> ): (params: T) => Promise<ToolResponse> { return async (params: T) => { try { const result = await handler(params); return createSuccessResponse(result); } catch (error) { return createErrorResponse(error); } }; }
- src/transformers/index.ts:367-383 (helper)transformToolOutput converts Vapi tool response to the ToolOutputSchema format for the MCP tool response.export function transformToolOutput( tool: Vapi.ToolsGetResponse ): z.infer<typeof ToolOutputSchema> { return { id: tool.id, createdAt: tool.createdAt, updatedAt: tool.updatedAt, type: tool.type || '', name: tool.function?.name || '', description: tool.function?.description || '', parameters: tool.function?.parameters || {}, server: { url: tool.server?.url || '', headers: tool.server?.headers as Record<string, string> || {}, } }; }