retell_get_agent
Retrieve configuration and details for a specific voice agent to manage its settings and conversation flows.
Instructions
Retrieve the configuration and details of a specific voice agent.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| agent_id | Yes | The unique identifier of the agent |
Implementation Reference
- src/index.ts:1171-1172 (handler)The switch case in executeTool function that handles execution of retell_get_agent by calling the generic retellRequest helper with the appropriate API endpoint.case "retell_get_agent": return retellRequest(`/get-agent/${args.agent_id}`, "GET");
- src/index.ts:507-516 (schema)Input schema definition specifying the required 'agent_id' parameter of type string.inputSchema: { type: "object", properties: { agent_id: { type: "string", description: "The unique identifier of the agent" } }, required: ["agent_id"] }
- src/index.ts:504-517 (registration)Tool registration object added to the 'tools' array, which is returned by the MCP listTools handler.{ name: "retell_get_agent", description: "Retrieve the configuration and details of a specific voice agent.", inputSchema: { type: "object", properties: { agent_id: { type: "string", description: "The unique identifier of the agent" } }, required: ["agent_id"] } },
- src/index.ts:23-57 (helper)Shared helper function for making authenticated HTTP requests to the Retell AI API, used by the retell_get_agent handler and all other tools.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(); }