Skip to main content
Glama

retell_end_chat

Terminate an active chat session in Retell AI's voice and chat agent platform by providing the session ID to manage conversation flows.

Instructions

End an active chat session.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
chat_idYesThe chat session ID to end

Implementation Reference

  • Executes the retell_end_chat tool by sending a PATCH request to the Retell API's /end-chat endpoint with the tool arguments using the retellRequest helper.
    case "retell_end_chat": return retellRequest("/end-chat", "PATCH", args);
  • Defines the input schema for the retell_end_chat tool, which requires a single 'chat_id' string parameter.
    inputSchema: { type: "object", properties: { chat_id: { type: "string", description: "The chat session ID to end" } }, required: ["chat_id"] }
  • src/index.ts:297-310 (registration)
    Registers the retell_end_chat tool in the MCP tools array, making it discoverable via the listTools request.
    { name: "retell_end_chat", description: "End an active chat session.", inputSchema: { type: "object", properties: { chat_id: { type: "string", description: "The chat session ID to end" } }, required: ["chat_id"] } },
  • Generic helper function for making authenticated API requests to the Retell AI service, used by all Retell tools including retell_end_chat.
    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(); }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/itsanamune/retellsimp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server