Skip to main content
Glama
brandon-fryslie

elevenlabs-mcp

create_agent

Create a custom conversational AI agent with configurable voice, language, and behavior settings for interactive experiences.

Instructions

Create a conversational AI agent with custom configuration.

⚠️ COST WARNING: This tool makes an API call to ElevenLabs which may incur costs. Only use when explicitly requested by the user.

Args:
    name: Name of the agent
    first_message: First message the agent will say i.e. "Hi, how can I help you today?"
    system_prompt: System prompt for the agent
    voice_id: ID of the voice to use for the agent
    language: ISO 639-1 language code for the agent
    llm: LLM to use for the agent
    temperature: Temperature for the agent. The lower the temperature, the more deterministic the agent's responses will be. Range is 0 to 1.
    max_tokens: Maximum number of tokens to generate.
    asr_quality: Quality of the ASR. `high` or `low`.
    model_id: ID of the ElevenLabs model to use for the agent.
    optimize_streaming_latency: Optimize streaming latency. Range is 0 to 4.
    stability: Stability for the agent. Range is 0 to 1.
    similarity_boost: Similarity boost for the agent. Range is 0 to 1.
    turn_timeout: Timeout for the agent to respond in seconds. Defaults to 7 seconds.
    max_duration_seconds: Maximum duration of a conversation in seconds. Defaults to 600 seconds (10 minutes).
    record_voice: Whether to record the agent's voice.
    retention_days: Number of days to retain the agent's data.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes
first_messageYes
system_promptYes
voice_idNocgSgspJ2msm6clMCkdW9
languageNoen
llmNogemini-2.0-flash-001
temperatureNo
max_tokensNo
asr_qualityNohigh
model_idNoeleven_turbo_v2
optimize_streaming_latencyNo
stabilityNo
similarity_boostNo
turn_timeoutNo
max_duration_secondsNo
record_voiceNo
retention_daysNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
typeYes
textYes
annotationsNo
_metaNo

Implementation Reference

  • The main handler function for the 'create_agent' tool. Creates a conversational AI agent by building a conversation config and platform settings, then calling the ElevenLabs API to create the agent.
    def create_agent(
        name: str,
        first_message: str,
        system_prompt: str,
        voice_id: str | None = DEFAULT_VOICE_ID,
        language: str = "en",
        llm: str = "gemini-2.0-flash-001",
        temperature: float = 0.5,
        max_tokens: int | None = None,
        asr_quality: str = "high",
        model_id: str = "eleven_turbo_v2",
        optimize_streaming_latency: int = 3,
        stability: float = 0.5,
        similarity_boost: float = 0.8,
        turn_timeout: int = 7,
        max_duration_seconds: int = 300,
        record_voice: bool = True,
        retention_days: int = 730,
    ) -> TextContent:
        conversation_config = create_conversation_config(
            language=language,
            system_prompt=system_prompt,
            llm=llm,
            first_message=first_message,
            temperature=temperature,
            max_tokens=max_tokens,
            asr_quality=asr_quality,
            voice_id=voice_id,
            model_id=model_id,
            optimize_streaming_latency=optimize_streaming_latency,
            stability=stability,
            similarity_boost=similarity_boost,
            turn_timeout=turn_timeout,
            max_duration_seconds=max_duration_seconds,
        )
    
        platform_settings = create_platform_settings(
            record_voice=record_voice,
            retention_days=retention_days,
        )
    
        response = client.conversational_ai.agents.create(
            name=name,
            conversation_config=conversation_config,
            platform_settings=platform_settings,
        )
    
        return TextContent(
            type="text",
            text=f"""Agent created successfully: Name: {name}, Agent ID: {response.agent_id}, System Prompt: {system_prompt}, Voice ID: {voice_id or "Default"}, Language: {language}, LLM: {llm}, You can use this agent ID for future interactions with the agent.""",
        )
  • The @mcp.tool decorator registration for 'create_agent', including the tool description and argument documentation.
    @mcp.tool(
        annotations=ToolAnnotations(destructiveHint=False, openWorldHint=True),
        description="""Create a conversational AI agent with custom configuration.
    
        ⚠️ COST WARNING: This tool makes an API call to ElevenLabs which may incur costs. Only use when explicitly requested by the user.
    
        Args:
            name: Name of the agent
            first_message: First message the agent will say i.e. "Hi, how can I help you today?"
            system_prompt: System prompt for the agent
            voice_id: ID of the voice to use for the agent
            language: ISO 639-1 language code for the agent
            llm: LLM to use for the agent
            temperature: Temperature for the agent. The lower the temperature, the more deterministic the agent's responses will be. Range is 0 to 1.
            max_tokens: Maximum number of tokens to generate.
            asr_quality: Quality of the ASR. `high` or `low`.
            model_id: ID of the ElevenLabs model to use for the agent.
            optimize_streaming_latency: Optimize streaming latency. Range is 0 to 4.
            stability: Stability for the agent. Range is 0 to 1.
            similarity_boost: Similarity boost for the agent. Range is 0 to 1.
            turn_timeout: Timeout for the agent to respond in seconds. Defaults to 7 seconds.
            max_duration_seconds: Maximum duration of a conversation in seconds. Defaults to 600 seconds (10 minutes).
            record_voice: Whether to record the agent's voice.
            retention_days: Number of days to retain the agent's data.
        """
    )
  • Helper function that builds the conversation configuration dictionary for the agent, including agent prompt, ASR, TTS, turn, and conversation settings.
    def create_conversation_config(
        language: str,
        system_prompt: str,
        llm: str,
        first_message: str | None,
        temperature: float,
        max_tokens: int | None,
        asr_quality: str,
        voice_id: str | None,
        model_id: str,
        optimize_streaming_latency: int,
        stability: float,
        similarity_boost: float,
        turn_timeout: int,
        max_duration_seconds: int,
    ) -> dict:
        return {
            "agent": {
                "language": language,
                "prompt": {
                    "prompt": system_prompt,
                    "llm": llm,
                    "tools": [{"type": "system", "name": "end_call", "description": ""}],
                    "knowledge_base": [],
                    "temperature": temperature,
                    **({"max_tokens": max_tokens} if max_tokens else {}),
                },
                **({"first_message": first_message} if first_message else {}),
                "dynamic_variables": {"dynamic_variable_placeholders": {}},
            },
            "asr": {
                "quality": asr_quality,
                "provider": "elevenlabs",
                "user_input_audio_format": "pcm_16000",
                "keywords": [],
            },
            "tts": {
                **({"voice_id": voice_id} if voice_id else {}),
                "model_id": model_id,
                "agent_output_audio_format": "pcm_16000",
                "optimize_streaming_latency": optimize_streaming_latency,
                "stability": stability,
                "similarity_boost": similarity_boost,
            },
            "turn": {"turn_timeout": turn_timeout},
            "conversation": {
                "max_duration_seconds": max_duration_seconds,
                "client_events": [
                    "audio",
                    "interruption",
                    "user_transcript",
                    "agent_response",
                    "agent_response_correction",
                ],
            },
            "language_presets": {},
            "is_blocked_ivc": False,
            "is_blocked_non_ivc": False,
        }
  • Helper function that builds the platform settings dictionary for the agent, including widget, privacy, auth, and call limits configuration.
    def create_platform_settings(
        record_voice: bool,
        retention_days: int,
    ) -> dict:
        return {
            "widget": {
                "variant": "full",
                "avatar": {"type": "orb", "color_1": "#6DB035", "color_2": "#F5CABB"},
                "feedback_mode": "during",
                "terms_text": '#### Terms and conditions\n\nBy clicking "Agree," and each time I interact with this AI agent, I consent to the recording, storage, and sharing of my communications with third-party service providers, and as described in the Privacy Policy.\nIf you do not wish to have your conversations recorded, please refrain from using this service.',
                "show_avatar_when_collapsed": True,
            },
            "evaluation": {},
            "auth": {"allowlist": []},
            "overrides": {},
            "call_limits": {"agent_concurrency_limit": -1, "daily_limit": 100000},
            "privacy": {
                "record_voice": record_voice,
                "retention_days": retention_days,
                "delete_transcript_and_pii": True,
                "delete_audio": True,
                "apply_to_existing_conversations": False,
            },
            "data_collection": {},
        }
Behavior4/5

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

Discloses that this tool incurs costs via an API call to ElevenLabs. Annotations are minimal (destructiveHint false, openWorldHint true) and not contradicted. The description could add more about side effects like data retention, but retention_days parameter covers that.

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

Conciseness3/5

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

Front-loaded with purpose and cost warning, but the parameter list is verbose, repeating defaults already in schema. Could be more concise without losing clarity.

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

Completeness4/5

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

Given the complexity (17 parameters, output schema present), the description covers parameter meanings, constraints, and costs. It does not explain return values, but output schema exists. Slightly incomplete on post-creation behavior.

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

Parameters5/5

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

With schema coverage at 0%, the description compensates fully by explaining each of the 17 parameters in detail, including ranges and defaults, adding significant meaning beyond the JSON schema.

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

Purpose5/5

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

The description starts with 'Create a conversational AI agent with custom configuration', which clearly states the verb and resource. This distinguishes it from sibling tools like get_agent or add_knowledge_base_to_agent.

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

Usage Guidelines4/5

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

Includes a cost warning that explicitly says 'Only use when explicitly requested by the user', providing strong usage guidance. However, it does not mention alternatives or when not to use this tool relative to siblings.

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/brandon-fryslie/vibedungeon-voice'

If you have feedback or need assistance with the MCP directory API, please join our Discord server