Skip to main content
Glama
baidu-xiling

Baidu Digital Human MCP Server

Official
by baidu-xiling

generateVoiceCloneLite

Create voice clones from uploaded audio files for use in speech synthesis and video production. Specify voice characteristics like gender and description, then generate sample audio with provided text.

Instructions

#工具说明:根据上传音频生成音色,可用于语音合成及视频制作.

样例1:

用户输入:用文件id为xxx的音频文件克隆声音。命名为“zhangsan”,是一个三十岁左右中年男性的音色,用“这个是我克隆的声音”这段文本试听一下 思考过程: 1.用户想要克隆一个声音,需要使用“generateVoiceCloneLite”工具。 2.工具需要参数,name,gender,describe,uploadAudioId,example,五个参数。 3.uploadAudioId的值为文件ID,name的值为zhangsan,describe的值为“一个三十岁左右中年男性的音色”,gender的值为male,example为“这个是我克隆的声音”

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes音色名称
describeYes音色描述
uploadAudioIdYes音频文件id
exampleTextYes音频文本
genderNo性别unknown

Implementation Reference

  • Registers the 'generateVoiceCloneLite' tool with the FastMCP server, providing the tool name and a detailed description with usage examples.
    @mcp.tool(
        name="generateVoiceCloneLite",
        description=(
        """
    #工具说明:根据上传音频生成音色,可用于语音合成及视频制作.
    # 样例1:
    用户输入:用文件id为xxx的音频文件克隆声音。命名为“zhangsan”,是一个三十岁左右中年男性的音色,用“这个是我克隆的声音”这段文本试听一下
    思考过程:
    1.用户想要克隆一个声音,需要使用“generateVoiceCloneLite”工具。
    2.工具需要参数,name,gender,describe,uploadAudioId,example,五个参数。
    3.uploadAudioId的值为文件ID,name的值为zhangsan,describe的值为“一个三十岁左右中年男性的音色”,gender的值为male,example为“这个是我克隆的声音”
        """)
    )
  • The handler function that executes the tool logic: validates inputs via Annotated types, constructs a VoiceCloneRequest, invokes the DHApiClient.voice_clone method for lite voice cloning, and returns the response or error.
    async def generateVoiceCloneLite(
            name: Annotated[str, Field(description="音色名称")],
            describe: Annotated[str, Field(description="音色描述")],
            uploadAudioId: Annotated[str, Field(description="音频文件id")],
            exampleText: Annotated[str, Field(description="音频文本")],
            gender: Annotated[Literal["male", "female", "unknown"], Field(description="性别", default="unknown")]
    ) -> MCPVoiceCloneResponse:
        """
        create a lite task of Clone a voice with upload audio file via the DH API.
    
        Args:
            name: 音色名称
            describe: 音色描述
            gender: 性别
            uploadAudioId: 音频文件id
            exampleText: 音频文本
            callbackUrl: 回调地址
    
        Return:
            perId: 音色克隆任务的ID
        """
        try:
            client = await getDhClient()
            req = VoiceCloneRequest(
                name=name,
                describe=describe,
                uploadAudioId=uploadAudioId,
                exampleText=exampleText,
                gender=gender.lower(),
            )
    
            ret = await client.voice_clone(req, True)
            return ret
        except Exception as e:
            return MCPVoiceCloneResponse(error=str(e))
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions the tool generates voice clones for synthesis/video, but doesn't cover critical behaviors: whether this creates a persistent resource, what permissions/authentication are needed, rate limits, or what happens on failure. The example shows parameter usage but lacks operational context.

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?

The description is front-loaded with the core purpose, but includes an extensive example that occupies most of the text. While the example is helpful, it could be more concise. The structure mixes tool explanation with instructional content, making it somewhat verbose for a tool description.

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?

For a tool with 5 parameters, no annotations, and no output schema, the description is incomplete. It explains what the tool does and provides an example, but misses critical context: what the tool returns (no output schema), error conditions, prerequisites (e.g., needing uploaded audio first via 'uploadFiles'), and how the generated voice clone integrates with sibling tools.

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 already documents all parameters thoroughly. The description's example illustrates parameter usage (e.g., 'name的值为zhangsan'), but doesn't add meaningful semantic context beyond what's in the schema descriptions. This meets the baseline for high schema coverage.

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: '根据上传音频生成音色,可用于语音合成及视频制作' (generate voice clone from uploaded audio for speech synthesis and video production). This specifies the verb (generate), resource (voice clone), and application context. However, it doesn't explicitly differentiate from sibling tools like 'generateText2Audio' or 'getVoices', which prevents a perfect score.

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. While it includes an example showing how to use the tool, it doesn't mention when NOT to use it or what sibling tools might be better for different scenarios. The example is instructional but not comparative.

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/baidu-xiling/mcp'

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