Skip to main content
Glama
VapiAI

Vapi MCP Server

Official
by VapiAI

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
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • 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); })
  • 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); }) );
  • 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'), });
  • 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); } }; }
  • 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> || {}, } }; }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/VapiAI/mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server