Skip to main content
Glama
al-one

MCP Server for notify to weixin / telegram / bark / lark

文本转音频

text_to_sound

Convert text to MP3 audio links for notifications across messaging platforms like Weixin, Telegram, Bark, and Lark. Supports multiple languages and adjustable speech speed.

Instructions

将一段文本转成mp3音频链接

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYes文本内容
langNo目标语言,支持: en/zh/cte(粤语)/ara/de/fra/kor/pt/ru/spa/th, 建议根据文本内容选择en
speedNo语速,默认7

Implementation Reference

  • The core handler function for the 'text_to_sound' tool. It generates a Baidu Fanyi TTS mp3 audio URL based on input text, language code, and speech speed.
    def text_to_sound(
        text: str = Field(description="文本内容"),
        lang: str = Field("en", description="目标语言,支持: en/zh/cte(粤语)/ara/de/fra/kor/pt/ru/spa/th, 建议根据文本内容选择"),
        speed: int = Field(7, description="语速,默认7"),
    ):
        if not text:
            return ""
        return 'https://fanyi.baidu.com/gettts?' + urlencode({
            'lan': lang,
            'spd': speed,
            'text': text,
            'source': 'web',
        })
  • Input schema using Pydantic Field for parameters: text (str), lang (str, default 'en'), speed (int, default 7). Includes descriptions in Chinese.
        text: str = Field(description="文本内容"),
        lang: str = Field("en", description="目标语言,支持: en/zh/cte(粤语)/ara/de/fra/kor/pt/ru/spa/th, 建议根据文本内容选择"),
        speed: int = Field(7, description="语速,默认7"),
    ):
  • Registers the text_to_sound tool with FastMCP using @mcp.tool decorator, providing Chinese title '文本转音频' (Text to Audio) and description.
    @mcp.tool(
        title="文本转音频",
        description="将一段文本转成mp3音频链接",
    )
  • Top-level registration invocation: calls util.add_tools(mcp) after creating FastMCP instance, which adds the text_to_sound tool.
    util.add_tools(mcp)
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions the output format (MP3 audio link) but lacks details on performance (e.g., processing time, rate limits), error handling, authentication needs, or whether the link is temporary/permanent. For a tool with no annotations, this is insufficient.

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 function without unnecessary words. It is front-loaded with the core purpose and appropriately sized for a straightforward tool.

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 lack of annotations and output schema, the description is incomplete. It covers the basic purpose but omits critical behavioral aspects (e.g., how the audio link is generated, any limitations, or response format). For a tool with no structured data to supplement it, more context is needed.

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%, so the schema fully documents all parameters (text, lang, speed). The description adds no parameter-specific information beyond what's in the schema, such as examples or constraints. With high schema coverage, a baseline score of 3 is appropriate.

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: '将一段文本转成mp3音频链接' (convert text to MP3 audio link). It specifies the verb (convert/transform) and resource (text to audio), making the function unambiguous. However, it doesn't explicitly differentiate from sibling tools (which are mostly notification/messaging tools), though the function is distinct enough that confusion is unlikely.

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?

No guidance is provided on when to use this tool versus alternatives. The description states what it does but offers no context about appropriate scenarios, prerequisites, or comparisons with other text-to-speech or audio generation tools. This leaves the agent without usage direction.

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/al-one/mcp-notify'

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