retell_get_chat_agent
Retrieve details of a specific chat agent to manage its configuration and conversation flows within the Retell AI platform.
Instructions
Retrieve details of a specific chat agent.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| agent_id | Yes | The chat agent ID |
Implementation Reference
- src/index.ts:642-655 (registration)Tool registration defining the name, description, and input schema for retell_get_chat_agent, which requires an agent_id.{ name: "retell_get_chat_agent", description: "Retrieve details of a specific chat agent.", inputSchema: { type: "object", properties: { agent_id: { type: "string", description: "The chat agent ID" } }, required: ["agent_id"] } },
- src/index.ts:1189-1190 (handler)Handler logic that performs a GET request to the Retell API endpoint `/get-chat-agent/{agent_id}` to fetch the chat agent details.case "retell_get_chat_agent": return retellRequest(`/get-chat-agent/${args.agent_id}`, "GET");
- src/index.ts:23-57 (helper)Shared helper function used by all Retell tools to make authenticated API requests to the Retell AI backend.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(); }