retell_get_llm
Retrieve a specific LLM configuration from Retell AI's voice and chat agent platform to manage conversation flows and agent behavior.
Instructions
Retrieve a Retell LLM configuration.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| llm_id | Yes | The LLM configuration ID |
Implementation Reference
- src/index.ts:1203-1204 (handler)Handler case in executeTool function that performs a GET request to the Retell API endpoint /get-retell-llm/{llm_id} using the generic retellRequest helper.case "retell_get_llm": return retellRequest(`/get-retell-llm/${args.llm_id}`, "GET");
- src/index.ts:740-753 (schema)Input schema definition for the retell_get_llm tool, requiring llm_id parameter.{ name: "retell_get_llm", description: "Retrieve a Retell LLM configuration.", inputSchema: { type: "object", properties: { llm_id: { type: "string", description: "The LLM configuration ID" } }, required: ["llm_id"] } },
- src/index.ts:23-57 (helper)Generic helper function for making authenticated HTTP requests to the Retell AI API, used by the retell_get_llm handler.async function retellRequest( endpoint: string, method: string = "GET", body?: Record<string, unknown> ): Promise<unknown> { const apiKey = getApiKey(); const headers: Record<string, string> = { "Authorization": `Bearer ${apiKey}`, "Content-Type": "application/json", }; const options: RequestInit = { method, headers, }; if (body && method !== "GET") { options.body = JSON.stringify(body); } const response = await fetch(`${RETELL_API_BASE}${endpoint}`, options); if (!response.ok) { const errorText = await response.text(); throw new Error(`Retell API error (${response.status}): ${errorText}`); } // Handle 204 No Content if (response.status === 204) { return { success: true }; } return response.json(); }
- src/index.ts:1283-1285 (registration)Registration of the tool list handler that exposes the retell_get_llm tool (included in the tools array) via MCP protocol.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools }; });
- src/index.ts:14-20 (helper)Helper function to retrieve the Retell API key from environment variable, used by retellRequest.function getApiKey(): string { const apiKey = process.env.RETELL_API_KEY; if (!apiKey) { throw new Error("RETELL_API_KEY environment variable is required"); } return apiKey; }