Skip to main content
Glama

retell_delete_call

Remove a call and its associated data, including recordings and transcripts, from the Retell AI platform.

Instructions

Delete a call and all associated data including recordings and transcripts.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
call_idYesThe unique identifier of the call to delete

Implementation Reference

  • Handler case in executeTool function that performs the DELETE request to Retell API endpoint /v2/delete-call/{call_id} using the generic retellRequest helper.
    case "retell_delete_call":
      return retellRequest(`/v2/delete-call/${args.call_id}`, "DELETE");
  • Tool definition including name, description, and input schema requiring 'call_id' parameter.
    {
      name: "retell_delete_call",
      description: "Delete a call and all associated data including recordings and transcripts.",
      inputSchema: {
        type: "object",
        properties: {
          call_id: {
            type: "string",
            description: "The unique identifier of the call to delete"
          }
        },
        required: ["call_id"]
      }
    },
  • src/index.ts:1283-1285 (registration)
    MCP server registration for listing all tools, which includes 'retell_delete_call' via the static 'tools' array.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return { tools };
    });
  • Generic HTTP request helper to Retell API with authentication, error handling, and JSON 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();
    }
  • src/index.ts:1287-1313 (registration)
    MCP server handler for tool execution (CallToolRequestSchema), which dispatches to executeTool based on tool name.
    // Register tool execution handler
    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,
        };
      }
    });

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