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 };
    });
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It states the tool creates a knowledge base but doesn't disclose behavioral traits such as required permissions, whether creation is idempotent, rate limits, or what happens on failure (e.g., duplicate names). For a mutation tool with zero annotation coverage, this is a significant gap in transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It is front-loaded with the core action ('Create a new knowledge base') and avoids redundancy, making it easy to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (a mutation operation with no annotations and no output schema), the description is incomplete. It lacks details on behavioral aspects (e.g., permissions, error handling) and doesn't hint at the return value or next steps (e.g., using 'retell_add_knowledge_base_sources'). For a creation tool, this leaves critical gaps for an agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents both parameters ('knowledge_base_name' and 'enable_auto_refresh') with clear descriptions. The description adds no additional meaning beyond what the schema provides, such as examples or constraints (e.g., name uniqueness). With high schema coverage, a baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Create a new knowledge base') and the purpose ('for providing context to agents'), which is specific and informative. It distinguishes from siblings like 'retell_list_knowledge_bases' (list) and 'retell_delete_knowledge_base' (delete), though it doesn't explicitly differentiate from 'retell_add_knowledge_base_sources' (add sources), which is a related but distinct operation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., whether an agent must exist first), timing (e.g., before adding sources), or comparisons to other tools like 'retell_list_knowledge_bases' for viewing existing ones. This leaves the agent without context for decision-making.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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