Skip to main content
Glama

retell_get_chat

Retrieve specific chat session details from Retell AI's agent platform to review conversations and manage interactions.

Instructions

Retrieve details of a specific chat session.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
chat_idYesThe unique identifier of the chat to retrieve

Implementation Reference

  • Handler logic for 'retell_get_chat' tool: extracts chat_id from args and makes a GET request to Retell API /get-chat/{chat_id} via retellRequest helper.
    case "retell_get_chat":
      return retellRequest(`/get-chat/${args.chat_id}`, "GET");
  • Input schema and metadata definition for the 'retell_get_chat' tool in the tools array.
    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:1283-1285 (registration)
    Registration of tool listing handler that exposes the tools array (including retell_get_chat) to MCP clients.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return { tools };
    });
  • src/index.ts:1288-1313 (registration)
    MCP tool execution request handler that dispatches to executeTool based on tool name, handling 'retell_get_chat' via the switch case.
    server.setRequestHandler(CallToolRequestSchema, async (request) => {
      const { name, arguments: args } = request.params;
    
      try {
        const result = await executeTool(name, args as Record<string, unknown>);
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(result, null, 2),
            },
          ],
        };
      } catch (error) {
        const errorMessage = error instanceof Error ? error.message : String(error);
        return {
          content: [
            {
              type: "text",
              text: `Error: ${errorMessage}`,
            },
          ],
          isError: true,
        };
      }
    });
  • Core helper function that makes authenticated HTTP requests to the Retell API, used by all tool handlers including retell_get_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