Skip to main content
Glama
inesaranab

Tavily Web Search MCP Server

by inesaranab

text_to_speech

Convert text into speech and save as MP3 files for accessibility or content creation purposes.

Instructions

Convert the given text into speech and save as MP3 file

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYes
voice_idNoJBFqnCBsd6RMkjVDRZzb

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • server.py:31-31 (registration)
    The @mcp.tool() decorator registers the text_to_speech tool with the MCP server.
    @mcp.tool()
  • server.py:32-57 (handler)
    The handler function that implements the text_to_speech tool logic: converts text to speech using ElevenLabs API, saves the audio as an MP3 file with a unique name, and returns the filename or error.
    def text_to_speech(text: str, voice_id: str = "JBFqnCBsd6RMkjVDRZzb") -> str:
        """Convert the given text into speech and save as MP3 file"""
        import uuid
        
        try:
            # Generate unique filename
            audio_filename = f"speech_{uuid.uuid4().hex[:8]}.mp3"
            
            # Generate audio using ElevenLabs
            audio = client_elevenlabs.text_to_speech.convert(
                text=text,
                voice_id=voice_id,
                model_id="eleven_multilingual_v2"
            )
            
            # Save audio to file
            with open(audio_filename, "wb") as f:
                for chunk in audio:
                    if chunk:
                        f.write(chunk)
            
            return f"Audio generated successfully! Saved as: {audio_filename}"
            
        except Exception as e:
            return f"Error generating speech: {str(e)}"
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 mentions converting text to speech and saving as MP3, implying a write operation, but lacks details on permissions, rate limits, file storage location, or error handling. This is a significant gap for a tool that likely involves file creation and external processing.

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 with zero waste, front-loading the core functionality. It's appropriately sized for the tool's complexity, making it easy to parse without unnecessary elaboration.

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

Completeness3/5

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

Given the tool has an output schema (which likely describes the MP3 file or result), the description doesn't need to explain return values. However, with no annotations, 0% schema coverage, and two parameters, it's incomplete—missing behavioral context and parameter details. It's minimally adequate but has clear gaps in guiding usage and transparency.

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

Parameters2/5

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

Schema description coverage is 0%, so the description must compensate for undocumented parameters. It mentions 'given text' and 'save as MP3 file', which loosely relates to the 'text' parameter but doesn't explain the 'voice_id' parameter or its default value. The description adds minimal meaning beyond the schema, failing to fully address the coverage gap.

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 tool's purpose with specific verbs ('convert', 'save') and resources ('text', 'MP3 file'), making it easy to understand what it does. However, it doesn't differentiate from sibling tools (roll_dice, web_search), which are unrelated, so it doesn't need sibling differentiation but could mention uniqueness in a broader context.

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 or in what contexts. It states what it does but offers no usage instructions, prerequisites, or exclusions, leaving the agent to infer appropriate scenarios without explicit help.

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/inesaranab/MCP'

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