list_models
View available AI voice models and per-minute pricing to compare options and manage costs for your phone agents.
Instructions
List available AI models for phone agents with their pricing per minute.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/models.ts:29-29 (handler)The actual handler function that executes the list_models tool - makes GET request to /models endpoint via client
async () => callTool(() => client.get("/models")) - src/tools/models.ts:24-28 (schema)Input/output schema definition for list_models tool - empty input schema (no parameters required), with annotations indicating it's read-only, non-destructive, and idempotent
{ description: "List available AI models for phone agents with their pricing per minute.", inputSchema: {}, annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false }, }, - src/tools/models.ts:21-31 (registration)Registration of the list_models tool within registerModelTools function - binds the tool name to its schema and handler
export function registerModelTools(server: McpServer, client: BubblyPhoneClient) { server.registerTool( "list_models", { description: "List available AI models for phone agents with their pricing per minute.", inputSchema: {}, annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false }, }, async () => callTool(() => client.get("/models")) ); } - src/tools/models.ts:12-19 (helper)Helper function that wraps tool execution with error handling - catches ApiError and returns formatted toolError or toolResult
async function callTool<T>(fn: () => Promise<T>) { try { return toolResult(await fn()); } catch (err) { const apiErr = err as ApiError; return toolError(`API error (${apiErr.status}): ${apiErr.message}`); } } - src/client.ts:21-31 (helper)BubblyPhoneClient.get() method - performs authenticated HTTP GET requests to the API, used by the list_models handler to fetch models data
async get<T = unknown>(path: string, params?: Record<string, string>): Promise<T> { const url = new URL(`${this.baseUrl}${path}`); if (params) { for (const [key, value] of Object.entries(params)) { if (value !== undefined && value !== "") { url.searchParams.set(key, value); } } } return this.request<T>(url.toString(), { method: "GET" }); }