Skip to main content
Glama

retell_create_knowledge_base

Create a knowledge base to provide context for AI agents, enabling them to access relevant information during conversations.

Instructions

Create a new knowledge base for providing context to agents.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
knowledge_base_nameYesName for the knowledge base
enable_auto_refreshNoWhether to automatically refresh sources

Implementation Reference

  • The switch case handler in the executeTool function that executes the tool by calling the generic retellRequest helper to POST to the Retell API's /create-knowledge-base endpoint with the provided arguments.
    case "retell_create_knowledge_base":
      return retellRequest("/create-knowledge-base", "POST", args);
  • The tool registration object in the tools array, including name, description, and inputSchema for parameter validation in MCP.
    {
      name: "retell_create_knowledge_base",
      description: "Create a new knowledge base for providing context to agents.",
      inputSchema: {
        type: "object",
        properties: {
          knowledge_base_name: {
            type: "string",
            description: "Name for the knowledge base"
          },
          enable_auto_refresh: {
            type: "boolean",
            description: "Whether to automatically refresh sources"
          }
        },
        required: ["knowledge_base_name"]
      }
    },
  • Generic helper function for making authenticated API requests to Retell AI, used by all tool handlers including this one.
    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:1283-1285 (registration)
    MCP server request handler for ListToolsRequestSchema that returns the tools array containing this tool's definition.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return { tools };
    });

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