Skip to main content
Glama
mamertofabian

ElevenLabs MCP Server

get_audio_file

Retrieve generated audio files from ElevenLabs text-to-speech jobs using the job ID to access and download speech content.

Instructions

Get the audio file content for a specific job

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
job_idYesID of the job to get audio file for

Implementation Reference

  • Registration of the 'get_audio_file' tool including its input schema definition.
    types.Tool(
        name="get_audio_file",
        description="Get the audio file content for a specific job",
        inputSchema={
            "type": "object",
            "properties": {
                "job_id": {
                    "type": "string",
                    "description": "ID of the job to get audio file for"
                }
            },
            "required": ["job_id"]
        }
    ),
  • Implementation of the get_audio_file tool handler: fetches job from database, reads the output audio file, base64 encodes it, and returns as an embedded resource.
    elif name == "get_audio_file":
        job_id = arguments.get("job_id")
        if not job_id:
            raise ValueError("job_id is required")
    
        # Get job to check if it exists and get file path
        job = await self.db.get_job(job_id)
        if not job:
            return [types.TextContent(
                type="text",
                text=f"Job {job_id} not found"
            )]
    
        if not job.output_file:
            return [types.TextContent(
                type="text",
                text=f"No output file found for job {job_id}"
            )]
    
        # Check if file exists
        output_path = Path(job.output_file)
        if not output_path.exists():
            return [types.TextContent(
                type="text",
                text=f"Output file not found at {job.output_file}"
            )]
    
        # Read the audio file and encode it as base64
        with open(output_path, 'rb') as f:
            audio_bytes = f.read()
            audio_base64 = base64.b64encode(audio_bytes).decode('utf-8')
    
        # Return the audio file content
        return [
            types.EmbeddedResource(
                type="resource",
                resource=types.BlobResourceContents(
                    uri=f"audio://{output_path.name}",
                    name=output_path.name,
                    blob=audio_base64,
                    mimeType="audio/mpeg"
                )
            )
        ]
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. It states the action but doesn't describe what 'Get' entails—whether it returns raw audio data, a file URL, or a stream; any authentication or permission requirements; rate limits; or error conditions (e.g., if the job doesn't exist or isn't ready). This leaves significant gaps for a tool that likely involves data retrieval.

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's front-loaded with the core action and resource, making it easy to parse. Every part of the sentence contributes to understanding the tool's function.

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 complexity of retrieving audio content (likely involving binary data or file handling), no annotations, and no output schema, the description is insufficient. It doesn't explain the return type (e.g., audio format, size limits), error handling, or behavioral details like whether it's idempotent or has side effects. This leaves the agent with incomplete information for proper invocation.

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%, with the single parameter 'job_id' fully documented in the schema. The description adds no additional meaning beyond implying the job must exist and have an associated audio file, but it doesn't specify format, constraints, or examples. This meets the baseline of 3 since the schema handles the parameter documentation adequately.

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 verb ('Get') and resource ('audio file content') with a specific target ('for a specific job'). It distinguishes from siblings like 'list_voices' or 'get_voiceover_history' by focusing on retrieving actual audio content rather than metadata or lists. However, it doesn't explicitly differentiate from potential similar tools like 'generate_audio_simple' beyond the 'get' vs 'generate' distinction.

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., needing a completed job), exclusions (e.g., not for in-progress jobs), or comparisons to siblings like 'get_voiceover_history' (which might retrieve metadata vs content). Usage is implied by the purpose but not explicitly stated.

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/mamertofabian/elevenlabs-mcp-server'

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