Skip to main content
Glama
Suixinlei

Tongyi Wanxiang MCP Server

by Suixinlei

wanx-t2v-video-generation

Generate videos from text prompts using Alibaba Cloud's Tongyi Wanxiang API. Initiate the process and use the result-fetching tool to retrieve the output once complete.

Instructions

使用阿里云万相文生视频大模型的文生视频能力,由于视频生成耗时比较久,需要调用 wanx-t2v-video-generation-result 工具获取结果

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
promptYes

Implementation Reference

  • src/index.ts:52-62 (registration)
    Registers the MCP tool 'wanx-t2v-video-generation' with description, input schema {prompt: z.string()}, and handler that calls generateVideo and returns task info.
    server.tool(
      "wanx-t2v-video-generation",
      "使用阿里云万相文生视频大模型的文生视频能力,由于视频生成耗时比较久,需要调用 wanx-t2v-video-generation-result 工具获取结果",
      { prompt: z.string() },
      async ({ prompt }) => {
        const result = await generateVideo(prompt);
        return {
          content: [{ type: "text", text: JSON.stringify(result) }],
        };
      }
    );
  • Input schema using Zod for the tool parameters.
    { prompt: z.string() },
  • Core handler function 'generateVideo' that makes async API call to Aliyun Dashscope to initiate video generation task and returns the task_id.
    export async function generateVideo(prompt: string) {  
      const apiKey = config.api.apiKey;
      const url = 'https://dashscope.aliyuncs.com/api/v1/services/aigc/video-generation/video-synthesis'; 
      const headers = {  
        'X-DashScope-Async': 'enable',
        'Authorization': `Bearer ${apiKey}`,  
        'Content-Type': 'application/json'  
      };  
      const payload = {  
        model: 'wanx2.1-t2v-turbo',  
        input: { prompt },
        parameters: {
          size: '832*480',
          duration: 5,
          prompt_extend: true,
        },
      };
    
      try {  
        const res = await axios.post(url, payload, { headers });  
        const taskId = res.data?.output?.task_id;  
        if (taskId) return taskId;  
        // 如果响应里没有task_id,说明有错误  
        throw res.data;  
      } catch (err: any) {  
        // err.response?.data 可能含详细错误  
        throw err.response?.data || err.message;  
      }  
    }  
Behavior3/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 adds useful context about the asynchronous nature (long processing time) and the need to poll with another tool, which is critical for understanding the tool's behavior. However, it doesn't mention other traits like potential rate limits, error conditions, authentication needs, or what happens if the prompt is invalid—leaving gaps for a mutation tool.

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 highly concise and well-structured in two sentences: the first states the core purpose, and the second provides critical usage guidance. Every sentence earns its place with no wasted words, making it easy to parse and front-loaded with essential information.

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's complexity (asynchronous video generation with no output schema and no annotations), the description is moderately complete. It covers the basic purpose and the need for a result tool, but lacks details on error handling, output format, or integration with siblings beyond the result tool. For a mutation tool with significant behavioral implications, more context would be beneficial.

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?

The input schema has 1 parameter with 0% description coverage, so the description must compensate. It implies the 'prompt' parameter is for text input to generate video, but doesn't add specific meaning beyond that (e.g., format, length constraints, or examples). Since schema coverage is low, the description provides minimal semantic value, meeting the baseline but not fully compensating for 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: it uses Alibaba Cloud's Wanxiang text-to-video model to generate videos from text prompts. It specifies the exact capability ('text-to-video generation') and mentions the resource (Alibaba Cloud Wanxiang model). However, it doesn't explicitly differentiate from its sibling 'wanx-t2i-image-generation' (text-to-image), though the naming implies the distinction.

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?

The description provides clear usage context by stating that video generation takes a long time and requires calling 'wanx-t2v-video-generation-result' to get results. This gives practical guidance on when to use this tool (for initiating generation) versus the sibling result tool (for retrieving results). It doesn't explicitly mention when not to use it or compare to alternatives like text-to-image, but the context is sufficient for basic usage.

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

Related 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/Suixinlei/tongyi-wanx-mcp-server'

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