Skip to main content
Glama

retell_delete_knowledge_base

Remove a knowledge base from the Retell AI platform by specifying its ID to manage agent information and resources.

Instructions

Delete a knowledge base.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
knowledge_base_idYesThe knowledge base ID to delete

Implementation Reference

  • Defines the Tool object for retell_delete_knowledge_base including name, description, and input schema requiring a knowledge_base_id.
    {
      name: "retell_delete_knowledge_base",
      description: "Delete a knowledge base.",
      inputSchema: {
        type: "object",
        properties: {
          knowledge_base_id: {
            type: "string",
            description: "The knowledge base ID to delete"
          }
        },
        required: ["knowledge_base_id"]
      }
    },
  • The switch case handler that executes the tool by calling retellRequest to DELETE the knowledge base via Retell API.
    case "retell_delete_knowledge_base":
      return retellRequest(`/delete-knowledge-base/${args.knowledge_base_id}`, "DELETE");
  • src/index.ts:1283-1285 (registration)
    Registers the listTools handler that returns the array of all tools, including retell_delete_knowledge_base.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return { tools };
    });
  • src/index.ts:1288-1293 (registration)
    Registers the callTool handler that dispatches to executeTool based on tool name, handling execution for retell_delete_knowledge_base.
    server.setRequestHandler(CallToolRequestSchema, async (request) => {
      const { name, arguments: args } = request.params;
    
      try {
        const result = await executeTool(name, args as Record<string, unknown>);
        return {
  • Generic helper function for making authenticated HTTP requests to the Retell API, 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();
    }

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