Skip to main content
Glama

retell_create_chat

Start a new chat session with a Retell AI agent to handle conversations, configure flows, and manage interactions through the MCP server platform.

Instructions

Create a new chat session with a chat agent.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
agent_idYesThe chat agent ID to use for the session
metadataNoOptional: Custom metadata for the chat session
retell_llm_dynamic_variablesNoOptional: Dynamic variables for personalized responses

Implementation Reference

  • Handler implementation in the executeTool switch statement: proxies the request to Retell API endpoint /create-chat with POST method and input arguments.
    case "retell_create_chat":
      return retellRequest("/create-chat", "POST", args);
  • Tool schema definition including name, description, and inputSchema used for validation and tool listing.
      name: "retell_create_chat",
      description: "Create a new chat session with a chat agent.",
      inputSchema: {
        type: "object",
        properties: {
          agent_id: {
            type: "string",
            description: "The chat agent ID to use for the session"
          },
          metadata: {
            type: "object",
            description: "Optional: Custom metadata for the chat session"
          },
          retell_llm_dynamic_variables: {
            type: "object",
            description: "Optional: Dynamic variables for personalized responses"
          }
        },
        required: ["agent_id"]
      }
    },
  • Core helper function that performs 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();
    }
  • src/index.ts:1283-1285 (registration)
    MCP request handler for listing tools, returns the tools array containing the retell_create_chat schema.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return { tools };
    });
  • src/index.ts:1288-1313 (registration)
    MCP request handler for calling tools, dispatches to executeTool based on tool name.
    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,
        };
      }
    });
Behavior2/5

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

No annotations are provided, so the description carries full burden for behavioral disclosure. While 'Create' implies a write/mutation operation, the description doesn't address important behavioral aspects like authentication requirements, rate limits, whether the chat session is persistent, what happens on creation failure, or what the tool returns. This leaves significant gaps for an agent to understand the tool's behavior.

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, clear sentence that states the core purpose without any unnecessary words. It's appropriately sized and front-loaded with the essential information, making it highly efficient.

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 that this is a creation/mutation tool with no annotations and no output schema, the description is insufficiently complete. It doesn't address what the tool returns, error conditions, or behavioral constraints. For a tool that creates resources, more contextual information is needed for an agent to use it effectively.

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 description provides no parameter information, but the input schema has 100% description coverage with clear documentation for all three parameters. According to scoring rules, when schema_description_coverage is high (>80%), the baseline is 3 even with no parameter information in the description, which applies here.

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 chat session') and the resource ('with a chat agent'), making the purpose immediately understandable. However, it doesn't distinguish this tool from similar sibling tools like 'retell_create_chat_completion' or 'retell_create_conversation_flow', which also involve chat/communication creation.

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. With multiple sibling tools involving chat creation (e.g., 'retell_create_chat_completion', 'retell_create_conversation_flow'), there's no indication of what differentiates this specific chat session creation tool from those other options.

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