Skip to main content
Glama

retell_create_chat_agent

Create a text-based chat agent by configuring LLM engines and webhooks for conversational AI applications.

Instructions

Create a new chat agent for text-based conversations.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
response_engineYesThe LLM engine configuration
agent_nameNoDisplay name for the chat agent
webhook_urlNoURL for receiving chat event webhooks

Implementation Reference

  • Handler logic for retell_create_chat_agent: makes a POST request to Retell API /create-chat-agent endpoint using the generic retellRequest helper.
    case "retell_create_chat_agent":
      return retellRequest("/create-chat-agent", "POST", args);
  • Input schema defining parameters for creating a chat agent: response_engine (required with type and optional llm_id), agent_name, webhook_url.
    {
      name: "retell_create_chat_agent",
      description: "Create a new chat agent for text-based conversations.",
      inputSchema: {
        type: "object",
        properties: {
          response_engine: {
            type: "object",
            description: "The LLM engine configuration",
            properties: {
              type: {
                type: "string",
                enum: ["retell-llm", "custom-llm"],
                description: "The type of response engine"
              },
              llm_id: {
                type: "string",
                description: "The LLM ID to use"
              }
            },
            required: ["type"]
          },
          agent_name: {
            type: "string",
            description: "Display name for the chat agent"
          },
          webhook_url: {
            type: "string",
            description: "URL for receiving chat event webhooks"
          }
        },
        required: ["response_engine"]
      }
    },
  • src/index.ts:1283-1285 (registration)
    Registers the listTools handler which returns the tools array containing retell_create_chat_agent.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return { tools };
    });
  • Generic HTTP client for Retell API: handles authentication, request formatting, error handling, and JSON parsing. Used by all tool handlers.
    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();
    }
  • Retrieves RETELL_API_KEY from environment and validates presence. Used by retellRequest.
    function getApiKey(): string {
      const apiKey = process.env.RETELL_API_KEY;
      if (!apiKey) {
        throw new Error("RETELL_API_KEY environment variable is required");
      }
      return apiKey;
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. While 'Create' implies a write/mutation operation, the description doesn't specify required permissions, whether this is idempotent, what happens on failure, or what the response contains. For a creation tool with zero annotation coverage, this leaves significant behavioral gaps.

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 gets straight to the point with zero wasted words. It's appropriately sized for a creation tool and front-loads the essential information. Every word earns its place.

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?

For a creation tool with no annotations and no output schema, the description is insufficiently complete. It doesn't explain what a 'chat agent' entails, what happens after creation, or what the tool returns. The agent must rely entirely on the input schema and tool name to understand the operation's full context.

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?

The schema description coverage is 100%, so the schema already documents all three parameters thoroughly. The description adds no additional parameter semantics beyond what's in the schema - it doesn't explain relationships between parameters, provide examples, or clarify edge cases. This meets the baseline for high schema coverage.

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') and resource ('new chat agent for text-based conversations'), making the purpose immediately understandable. It distinguishes this from non-chat agent creation tools like 'retell_create_phone_call' or 'retell_create_conversation_flow', though it doesn't explicitly differentiate from the similarly named 'retell_create_agent' sibling tool.

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, when not to use it, or how it differs from similar tools like 'retell_create_agent' or 'retell_create_chat_completion'. The agent must infer usage context from the tool name alone.

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