retell_get_chat
Retrieve details of a specific chat session by providing its unique identifier to access conversation data and manage interactions.
Instructions
Retrieve details of a specific chat session.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chat_id | Yes | The unique identifier of the chat to retrieve |
Implementation Reference
- src/index.ts:1143-1144 (handler)The switch case handler that executes the retell_get_chat tool by calling the retellRequest helper with the appropriate GET endpoint using the provided chat_id.case "retell_get_chat": return retellRequest(`/get-chat/${args.chat_id}`, "GET");
- src/index.ts:248-261 (registration)Registration of the retell_get_chat tool in the tools array, including name, description, and input schema. This array is returned by the MCP list tools handler.{ name: "retell_get_chat", description: "Retrieve details of a specific chat session.", inputSchema: { type: "object", properties: { chat_id: { type: "string", description: "The unique identifier of the chat to retrieve" } }, required: ["chat_id"] } },
- src/index.ts:251-260 (schema)Input schema defining the expected parameters (chat_id: string) for the retell_get_chat tool.inputSchema: { type: "object", properties: { chat_id: { type: "string", description: "The unique identifier of the chat to retrieve" } }, required: ["chat_id"] }
- src/index.ts:23-57 (helper)Supporting utility function that performs the actual HTTP request to the Retell API, handling authentication, JSON serialization, error handling, and response parsing. Used by the tool 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(); }