z_ai_image_gen_mcp
This server provides an MCP interface for Z.AI's image and video generation models, enabling programmatic creation of visual content. Key capabilities include:
Image Generation: Discover available models (GLM-Image, CogView-4) with
list_models, generate images synchronously (generate_image) or asynchronously (generate_image_async) from text prompts, download results as base64 or files (download_image), and combine generation with download in one step (generate_and_download_image).Video Generation: List video models (CogVideoX-3, Vidu Q1, Vidu 2) with
list_video_models, generate videos asynchronously (generate_video) from text, images, or start-end frames with control over resolution, duration, style, and audio, poll results (get_video_result), and generate plus download in one operation (generate_and_download_video).Asynchronous Handling: Long-running tasks use automatic retries with exponential backoff, and you can check status with
get_async_resultorget_video_result.Model Discovery:
list_modelsandlist_video_modelsprovide available models and their specific parameters (resolution, aspect ratio, etc.).Flexible Inputs: Support for text-to-image/video, image-to-video, start-end frame animation, and reference-based generation.
Output Options: Receive generated media as base64 data or save directly to local files.
Easy Configuration: Set API key, base URL, default models, timeouts, and retries via environment variables.
Seamless Integration: Works with MCP clients like Claude Desktop and OpenCode, with full TypeScript support and input validation.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@z_ai_image_gen_mcpgenerate a realistic image of a cat sitting on a chair"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Z.AI Image & Video Generation MCP Server
A Model Context Protocol (MCP) server that provides access to Z.AI's image and video generation models for LLM applications.
Features
Image Generation: GLM-Image and CogView-4 models for high-quality image generation
Video Generation: CogVideoX-3, Vidu Q1, and Vidu 2 models for AI video creation
Multiple Input Modes: Text-to-image/video, image-to-video, start-end frame animation
Asynchronous Processing: Submit long-running tasks and poll for results
Automatic Downloads: Generate and download in a single operation
Automatic Retries: Built-in retry logic with exponential backoff
Comprehensive Validation: Input validation with clear error messages
Type-Safe: Full TypeScript support with detailed type definitions
Related MCP server: glm-image-mcp-server
Installation
npm install z-ai-image-mcpConfiguration
Set your Z.AI API key as an environment variable:
export ZAI_API_KEY=your_api_key_hereGet your API key from the Z.AI API Keys page or sign up for the GLM Coding Plan.
Optional Configuration
Environment Variable | Description | Default |
| API base URL |
|
| Default model |
|
| Default image size |
|
| Request timeout (ms) |
|
| Max retry attempts |
|
| Initial retry delay (ms) |
|
Usage
With Claude Desktop
Add to your Claude Desktop configuration (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
{
"mcpServers": {
"z-ai-image": {
"command": "npx",
"args": ["z-ai-image-mcp"],
"env": {
"ZAI_API_KEY": "your_api_key_here"
}
}
}
}With Other MCP Clients
Run the server directly:
npx z-ai-image-mcpOr programmatically:
import { createServer, loadConfig } from 'z-ai-image-mcp';
const config = loadConfig();
const server = createServer(config);
// Connect to your transport...With OpenCode
Add to your OpenCode configuration (opencode.json or opencode.jsonc in your project root):
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"z-ai-image": {
"type": "local",
"command": ["npx", "z-ai-image-mcp"],
"enabled": true,
"environment": {
"ZAI_API_KEY": "your_api_key_here"
}
}
}
}Or using an environment variable reference:
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"z-ai-image": {
"type": "local",
"command": ["npx", "z-ai-image-mcp"],
"enabled": true,
"environment": {
"ZAI_API_KEY": "{env:ZAI_API_KEY}"
}
}
}
}Using with OpenCode prompts:
Generate a professional logo for a tech startup. use z-ai-imageOr add to your AGENTS.md:
When generating images, use the `z-ai-image` MCP server tools.Per-agent configuration (optional):
To enable the MCP server only for specific agents:
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"z-ai-image": {
"type": "local",
"command": ["npx", "z-ai-image-mcp"],
"enabled": true,
"environment": {
"ZAI_API_KEY": "{env:ZAI_API_KEY}"
}
}
},
"tools": {
"z-ai-image*": false
},
"agent": {
"design-agent": {
"tools": {
"z-ai-image*": true
}
}
}
}Available Tools
1. list_models
List all available image generation models and their capabilities.
Use this tool to discover available models, their features, and recommended settings.2. generate_image
Generate an image synchronously from a text prompt.
Parameters:
prompt(required): Text description of the image (max 4000 characters)model(optional):glm-imageorcogview-4-250304(default:glm-image)size(optional): Image dimensions, e.g.,1280x1280(default:1280x1280)quality(optional):hdorstandard(default:hdfor GLM-Image)user_id(optional): End user ID for abuse prevention (6-128 characters)
Example:
Generate an image of a cute kitten sitting on a windowsill with a sunset background.3. generate_image_async
Start an asynchronous image generation task. Returns a task ID for polling.
Parameters:
prompt(required): Text description of the imagemodel(optional): Onlyglm-imagesupports async (default:glm-image)size(optional): Image dimensions (default:1280x1280)quality(optional): Onlyhdsupported for async (default:hd)user_id(optional): End user ID for abuse prevention
Example:
Start async generation of a complex poster design.4. get_async_result
Retrieve the result of an asynchronous image generation task.
Parameters:
task_id(required): The task ID fromgenerate_image_async
Example:
Check the status of task ID "task-12345".5. download_image
Download an image from a URL and return it as base64 or save to a file.
Parameters:
url(required): The URL of the image to download (e.g., fromgenerate_imageorget_async_result)output(optional):base64orfile_output(default:base64)file_output(optional): Absolute path to save the image file (required if output isfile_output). Example:/path/to/image.png
Output Modes:
base64: Returns the image data directly as base64 (auto-switches to file if > 1MB)file_output: Saves the image to disk at the specified path
Example:
Download the generated image and save it to /home/user/images/logo.pngNote: Z.AI image URLs expire after 30 days. Use this tool to download and store images permanently.
6. generate_and_download_image ⭐ Recommended
Generate an image and automatically download it in a single operation. This is the most convenient tool when you want the image data immediately.
Parameters:
prompt(required): Text description of the image (max 4000 characters)model(optional):glm-imageorcogview-4-250304(default:glm-image)size(optional): Image dimensions, e.g.,1280x1280(default:1280x1280)quality(optional):hdorstandard(default:hdfor GLM-Image)user_id(optional): End user ID for abuse prevention (6-128 characters)output(optional):base64orfile_output(default:base64)file_output(optional): Absolute path to save the image file (required if output isfile_output)poll_interval(optional): Seconds to wait between polling for async results (default: 3)max_wait(optional): Maximum seconds to wait for generation (default: 120)
Output Modes:
base64: Returns the image data directly as base64 (auto-switches to file if > 1MB)file_output: Saves the image to disk at the specified path
Examples:
# Generate and get as base64
Generate a logo for my company and show me the image.
# Generate and save to file
Generate a logo and save it to /home/user/images/logo.pngBehavior:
For GLM-Image: Uses async API with automatic polling until complete
For CogView-4: Uses synchronous API
Automatically downloads the result once generation completes
Returns image as base64 or saves to specified path
Video Generation Tools
7. list_video_models
List all available video generation models and their capabilities.
Use this tool to discover available video models, their features, and supported parameters.8. generate_video
Generate a video asynchronously from text or images. Returns a task ID for polling.
Parameters:
model(required): Video generation modelcogvideox-3: Z.AI flagship model (up to 4K, 5-10s, audio support)viduq1-text: Text-to-video, 1080P, 5sviduq1-image: Image-to-video, 1080P, 5sviduq1-start-end: Start-end frame, 1080P, 5svidu2-image: Image-to-video, 720P, 4s (faster, cheaper)vidu2-start-end: Start-end frame, 720P, 4svidu2-reference: Reference-based, 720P, 4s
prompt(optional): Text description (max 512 characters)image_url(optional): Image URL(s) for image-to-video generationquality(CogVideoX-3):qualityorspeedsize(optional): Video resolutionduration(optional): Video duration in secondsfps(CogVideoX-3): 30 or 60with_audio(optional): Generate AI sound effectsstyle(Vidu Q1 text):generaloranimeaspect_ratio(Vidu Q1/2):16:9,9:16, or1:1movement_amplitude(Vidu):auto,small,medium, orlargeuser_id(optional): End user ID for abuse prevention
Examples:
# Text-to-video
Generate a video of a cat playing with a ball.
# Image-to-video
Animate this image: [image_url]
# Start-end frame
Create a smooth transition from [first_frame] to [last_frame].9. get_video_result
Retrieve the result of an asynchronous video generation task.
Parameters:
task_id(required): The task ID fromgenerate_video
Note: Video generation typically takes 30 seconds to several minutes depending on duration and quality.
10. generate_and_download_video ⭐ Recommended
Generate a video and automatically download it. Polls for completion and saves the video file.
Parameters:
All parameters from
generate_videoplus:file_output(optional): Absolute path to save the video filepoll_interval(optional): Seconds to wait between polling (default: 10)max_wait(optional): Maximum seconds to wait (default: 300)
Example:
Generate a video of a sunset over the ocean and save it to /home/user/videos/sunset.mp4Note: Videos are always saved to file (too large for base64). Video URLs expire after 1 day.
Models
GLM-Image
Z.AI's flagship image generation model with a hybrid autoregressive + diffusion architecture.
Best for: Complex compositions, text rendering, detailed illustrations, commercial posters
Quality options:
hd(detailed, ~20s),standard(faster, ~5-10s)Size range: 1024-2048px per dimension (divisible by 32)
Recommended sizes: 1280×1280, 1568×1056, 1056×1568, 1472×1088, 1088×1472, 1728×960, 960×1728
Async support: Yes
CogView-4-250304
General-purpose image generation with fast text understanding.
Best for: General image generation, quick iterations
Quality options:
hd,standardSize range: 512-2048px per dimension (divisible by 16)
Recommended sizes: 1024×1024, 768×1344, 864×1152, 1344×768, 1152×864, 1440×720, 720×1440
Async support: No
Video Models
CogVideoX-3
Z.AI's flagship video generation model with improved frame stability and clarity.
Best for: Text-to-video, image-to-video, start-end frame animation
Resolution: Up to 4K (3840x2160)
Duration: 5 or 10 seconds
Features: Audio generation, 30/60 FPS, quality/speed modes
Price: $0.20/video
Vidu Q1
High-quality video generation with 1080P output.
Model | Capability | Duration | Price |
| Text-to-video | 5s | $0.40 |
| Image-to-video | 5s | $0.40 |
| Start-end frame | 5s | $0.40 |
Features: General/anime styles, motion amplitude control
Vidu 2
Fast and cost-effective video generation with 720P output.
Model | Capability | Duration | Price |
| Image-to-video | 4s | $0.20 |
| Start-end frame | 4s | $0.20 |
| Reference-based | 4s | $0.40 |
Features: Audio generation, motion amplitude control, multi-image reference
Error Handling
The server handles various error scenarios:
Error Type | Description |
| Invalid or missing API key |
| Too many requests - will auto-retry |
| Invalid parameters |
| Z.AI server issues - will auto-retry |
| Connection issues - will auto-retry |
| Request timeout - will auto-retry |
| Prompt blocked by content policy |
Development
Setup
git clone https://github.com/GeorgH93/z_ai_image_gen_mcp.git
cd z_ai_image_gen_mcp
npm install
cp .env.example .env
# Edit .env with your API keyScripts
npm run build # Build TypeScript
npm run dev # Run in development mode
npm test # Run all tests
npm run test:unit # Run unit tests only
npm run test:integration # Run integration tests
npm run test:e2e # Run E2E tests
npm run test:coverage # Run tests with coverage
npm run typecheck # Type check without emitLicense
MIT
Links
Available Tools
10 toolsdownload_imageA
Download an image from a URL and return it as base64 or save to a file. Use this after generating an image to get the actual image data. Note: Z.AI image URLs expire after 30 days.
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | The URL of the image to download (e.g., from generate_image or get_async_result) | |
| output | No | Output format: "base64" returns the image data directly, "file_output" saves to disk | base64 |
| file_output | No | Absolute path to save the image file (required if output is "file_output"). Example: /path/to/image.png |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It explains the core behavior (download, return base64 or save to file) and mentions URL expiry. However, it lacks details on potential failure modes, rate limits, or authentication requirements. With no annotations, this is minimally adequate but not comprehensive.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is extremely concise: two sentences and a note. Every sentence adds value: first states action and options, second provides usage context, and the note gives an important constraint. No wasted words.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple download tool with three parameters and no output schema, the description covers the essential points: what it does, when to use it, output options, and a critical caveat (URL expiry). It lacks details about error handling or file path requirements, but these are partly covered by the schema. Overall, it is quite complete for the tool's complexity.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100% (all three parameters have descriptions). Baseline is 3. The description adds context by echoing the output enum and clarifying the URL source from generation, but does not significantly deepen parameter understanding beyond the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb 'Download' and the resource 'image from a URL', and specifies the available output options (base64 or file). It distinguishes from sibling tools by indicating this is for downloading an image URL, typically after generation.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explicitly says 'Use this after generating an image to get the actual image data', providing clear when-to-use guidance. It also notes URL expiry, which is a time constraint. It does not explicitly contrast with sibling tools that combine generation and download, but the context is sufficient.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
generate_and_download_imageA
Generate an image and automatically download it. This combines generate_image and download_image into a single operation. Returns the image as base64 or saves to a file. Best for when you want the image data immediately.
| Name | Required | Description | Default |
|---|---|---|---|
| size | No | Image size (e.g., "1280x1280", "1568x1056") | 1280x1280 |
| model | No | Model to use for generation | glm-image |
| output | No | Output format: "base64" returns the image data directly, "file_output" saves to disk | base64 |
| prompt | Yes | Text description of the image to generate | |
| quality | No | Quality level: "hd" (more detailed, ~20s) or "standard" (faster, ~5-10s) | |
| user_id | No | Unique end user ID for abuse prevention (6-128 characters) | |
| max_wait | No | Maximum seconds to wait for image generation (default: 120) | |
| file_output | No | Absolute path to save the image file (required if output is "file_output"). Example: /path/to/image.png | |
| poll_interval | No | Seconds to wait between polling for async results (default: 3) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries full burden. It mentions the combined operation and output formats but does not explain polling behavior, potential waiting, or side effects. Parameters like max_wait and poll_interval hint at async behavior, but the description lacks explicit disclosure.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is three sentences with no redundancy. It front-loads the core action, then clarifies the combination, and ends with output format. Every sentence is necessary and earns its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool has 9 parameters and no output schema, the description is too minimal. It omits details about the async/polling behavior, how to use the output format, and the requirement for file_output path when output is 'file_output'. The presence of sibling tools like generate_image_async and get_async_result further highlights the need for clearer behavioral context.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so baseline is 3. The description adds no additional meaning beyond the schema's parameter descriptions. Each parameter is adequately described in the schema, so no further elaboration is needed.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states that this tool generates and downloads an image in a single operation, combining generate_image and download_image. It distinguishes itself from sibling tools by explicitly naming the combination and indicating it's best for immediate image data needs.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides a clear usage context ('Best for when you want the image data immediately'). It does not specify when to avoid using it or when to prefer the separate sibling tools, but the combined nature implies a convenience trade-off.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
generate_and_download_videoA
Generate a video and automatically download it. Polls for completion and returns the video file. Best for when you want the video data immediately.
| Name | Required | Description | Default |
|---|---|---|---|
| fps | No | CogVideoX-3 only: Frame rate | |
| size | No | Video resolution | |
| model | Yes | Video generation model to use | |
| style | No | Vidu Q1 text-to-video only: Style | |
| prompt | No | Text description of the video (max 512 characters) | |
| quality | No | CogVideoX-3 only: output mode | |
| user_id | No | Unique end user ID | |
| duration | No | Video duration in seconds | |
| max_wait | No | Maximum seconds to wait for video generation (default: 300) | |
| image_url | No | Image URL(s) for image-to-video generation | |
| with_audio | No | Whether to generate AI sound effects | |
| file_output | No | Absolute path to save the video file. Example: /path/to/video.mp4 | |
| aspect_ratio | No | Aspect ratio | |
| poll_interval | No | Seconds to wait between polling (default: 10, videos take longer than images) | |
| movement_amplitude | No | Vidu models only: Motion amplitude |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The description mentions polling behavior and returning the file, adding value beyond the schema. No annotations exist, so this is adequate disclosure.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences with clear, front-loaded purpose. No redundant or empty phrasing.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With 15 parameters, no output schema, and no annotations, the description is too brief to fully guide the agent on handling failures, return format, or usage nuances.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so baseline is 3. The description adds no parameter-specific information beyond the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb 'generate and download' and the resource 'video', and distinguishes from sibling tools by indicating it is for immediate retrieval.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
'Best for when you want the video data immediately' provides context for when to use, but does not explicitly state when not to use or name alternatives like generate_video/get_video_result.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
generate_imageA
Generate an image synchronously from a text prompt. Returns the image URL directly. Use this for most image generation tasks.
| Name | Required | Description | Default |
|---|---|---|---|
| size | No | Image size (e.g., "1280x1280", "1568x1056") | 1280x1280 |
| model | No | Model to use for generation | glm-image |
| prompt | Yes | Text description of the image to generate | |
| quality | No | Quality level: "hd" (more detailed, ~20s) or "standard" (faster, ~5-10s) | |
| user_id | No | Unique end user ID for abuse prevention (6-128 characters) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Discloses synchronous execution and direct URL return, which are key behavioral traits. However, with no annotations, the description carries the full burden and omits other relevant details such as authentication, rate limits, or cost implications.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences, highly concise and front-loaded with the core purpose. Every sentence adds value: first states the action and output, second recommends usage. No wasted words.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given 5 parameters and no output schema, the description is overly minimal. It covers the basic purpose but lacks details on error handling, parameter interdependencies, or example usage, leaving the agent with incomplete contextual understanding.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100% for all 5 parameters, so baseline is 3. The description does not add extra semantics beyond what the schema already provides for parameters like prompt, size, model, quality, and user_id.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description clearly states 'Generate an image synchronously from a text prompt' and 'Returns the image URL directly', which specifies the verb and resource. It implicitly distinguishes from the sibling generate_image_async by noting synchronous behavior, though it does not explicitly name the async alternative.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Says 'Use this for most image generation tasks' to indicate when to use, but provides no guidance on when not to use or what alternatives exist (e.g., generate_image_async). No exclusions or context with siblings.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
generate_image_asyncA
Start an asynchronous image generation task. Returns a task ID to poll for results. Use this for long-running generations or when you need to process multiple images.
| Name | Required | Description | Default |
|---|---|---|---|
| size | No | Image size (e.g., "1280x1280", "1568x1056") | 1280x1280 |
| model | No | Model to use (only glm-image supports async) | glm-image |
| prompt | Yes | Text description of the image to generate | |
| quality | No | Quality level (only "hd" supported for async) | hd |
| user_id | No | Unique end user ID for abuse prevention (6-128 characters) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It discloses the async behavior and the need to poll for results. It could add details about polling mechanics or error handling, but it is sufficient for most use cases.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences: first defines the tool's action, second provides usage guidance. No fluff, front-loaded information.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given no output schema, the description adequately mentions the return value (task ID). It could explicitly reference 'get_async_result' for polling, but the context of async generation is clearly set.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema already explains all parameters. The description does not add additional meaning to individual parameters; it sets the overall context for the async task.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states it starts an asynchronous image generation task and returns a task ID. It uses specific verbs ('Start', 'Returns') and resource ('task ID'). The async nature distinguishes it from siblings like 'generate_image'.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly says 'Use this for long-running generations or when you need to process multiple images.' This provides clear context for when to use, though it does not explicitly mention alternatives or when not to use.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
generate_videoA
Generate a video asynchronously from text or images. Returns a task ID to poll for results. Supports multiple models: CogVideoX-3 (text/image/start-end frame), Vidu Q1 (1080P), Vidu 2 (720P, faster).
| Name | Required | Description | Default |
|---|---|---|---|
| fps | No | CogVideoX-3 only: Frame rate (30 or 60) | |
| size | No | Video resolution (e.g., "1920x1080", "1280x720"). Model-specific defaults apply. | |
| model | Yes | Video generation model to use | |
| style | No | Vidu Q1 text-to-video only: Style of the video | |
| prompt | No | Text description of the video (max 512 characters). Required for text-to-video models. | |
| quality | No | CogVideoX-3 only: "quality" for higher quality, "speed" for faster generation | |
| user_id | No | Unique end user ID for abuse prevention (6-128 characters) | |
| duration | No | Video duration in seconds. Model-specific: CogVideoX-3: 5 or 10, Vidu Q1: 5, Vidu 2: 4 | |
| image_url | No | Image URL(s) for image-to-video generation. Single URL or array of URLs for start-end frame/reference images. | |
| with_audio | No | Whether to generate AI sound effects (CogVideoX-3, Vidu 2) | |
| aspect_ratio | No | Vidu Q1 text/reference only: Aspect ratio | |
| movement_amplitude | No | Vidu models only: Motion amplitude |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Discloses async behavior and model differences but omits details on failure modes, timeouts, auth requirements, or rate limits. No annotations exist to compensate, so description carries full burden but falls short.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences, no redundancy. Front-loaded with the core action and key details. Every word earns its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Adequate for a tool with thorough schema descriptions, but lacks examples or guidance on parameter combinations. No output schema means description should clarify return value further, which it does minimally.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema itself documents all parameters. The description adds minimal extra context beyond listing model capabilities, so baseline of 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Clearly states it generates a video asynchronously from text or images and returns a task ID. Lists supported models, distinguishing it from sibling tools like generate_image_async and get_async_result.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Indicates async nature and need to poll for results, hinting at use with get_async_result. Does not explicitly state when not to use or compare with synchronous alternatives like generate_and_download_video.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_async_resultA
Retrieve the result of an asynchronous image generation task. Use the task ID from generate_image_async.
| Name | Required | Description | Default |
|---|---|---|---|
| task_id | Yes | The task ID returned by generate_image_async |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description fully bears the burden of behavioral disclosure. It does not mention whether the call is read-only, what happens if the task is pending or fails, any authentication requirements, or rate limits. Critical behavioral traits are missing.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is extremely concise: a single sentence with two clear parts. It is front-loaded with the purpose and immediately provides usage context. No words are wasted.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's simplicity and lack of output schema, the description is somewhat incomplete. It omits details about the result format, possible statuses (e.g., pending, success, failure), and error handling. For a polling tool, such context is important for correct usage.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema already covers the parameter 'task_id' with a clear description, achieving 100% coverage. The tool description adds minimal new meaning, only reinforcing that the ID comes from generate_image_async. Thus, the description does not significantly enhance the schema's explanation.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('Retrieve the result') and the resource ('asynchronous image generation task'), and it explicitly links to the sibling tool 'generate_image_async', differentiating it from synchronous or video counterparts.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description specifies when to use this tool: after calling generate_image_async and using its task ID. It provides clear context but does not explicitly state when not to use it or list alternative tools for different scenarios.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_video_resultA
Retrieve the result of an asynchronous video generation task. Use the task ID from generate_video.
| Name | Required | Description | Default |
|---|---|---|---|
| task_id | Yes | The task ID returned by generate_video |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries full burden. It only states 'Retrieve the result' without disclosing whether the call is idempotent, non-destructive, or if it can return pending states. Lacks details on polling behavior.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences with no redundancy; front-loaded with the core purpose. Every word is meaningful.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given a single parameter and no output schema, the description is minimally adequate. However, it omits mention of potential states (e.g., pending, completed) and any guidance on polling behavior.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% and the schema already describes the parameter as 'The task ID returned by generate_video'. The description adds no additional meaning beyond what is in the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description clearly states 'Retrieve the result of an asynchronous video generation task', specifying the action and resource. Distinguishes from siblings like get_async_result by explicitly mentioning video generation.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The phrase 'Use the task ID from generate_video' gives context for when to use, but there is no guidance on when not to use, such as for tasks still processing, or alternatives like get_async_result.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_modelsA
List available Z.AI image generation models and their capabilities
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, so description carries full burden. It describes a read-only listing but does not disclose any behavioral traits like rate limits or authentication requirements. Lack of side effects makes this adequate, but not exceptional.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Single sentence, front-loaded with the primary action, no unnecessary words. Efficient and clear.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
No output schema, but for a list tool with no parameters, the description is reasonably complete. Could specify output format but not essential given sibling context (list_video_models).
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
No parameters exist, so description cannot add parameter info. With 0 params, the description is sufficient and clear.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description states the verb 'List', the resource 'available Z.AI image generation models', and what it provides ('their capabilities'). It clearly distinguishes from sibling tools like generate_image and list_video_models.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No explicit guidance on when to use or when not. However, the context of sibling tools (e.g., list_video_models for video models) implies usage for image model discovery.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_video_modelsA
List available Z.AI video generation models and their capabilities
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries full burden. It discloses that it lists models and capabilities, which implies a safe read operation. However, it does not describe specifics such as whether the list is real-time or cached, auth requirements, or rate limits.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
One sentence that is efficient and front-loaded. The word 'capabilities' is slightly vague but acceptable. Could be more specific without losing conciseness.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With no output schema and no annotations, the description is minimally complete. It tells the agent it lists models and capabilities, but not the return format or whether capabilities are structured. Adequate for a simple list tool but could add more context.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has zero parameters, so schema coverage is 100%. The description adds meaning by specifying that the output includes 'capabilities', which is beyond the schema. No param details needed.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('List') and the resource ('available Z.AI video generation models') with an added detail about capabilities, distinguishing it from the sibling 'list_models' tool.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
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 like 'list_models'. The agent is left to infer that this is specific to video models, but no explicit when-to-use or when-not-to-use advice is given.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
10 tool updates
v2.0.0- First observed
download_image - First observed
generate_and_download_image - First observed
generate_and_download_video - First observed
generate_image - First observed
generate_image_async - First observed
generate_video - First observed
get_async_result - First observed
get_video_result - First observed
list_models - First observed
list_video_models
TDQS
Scored across 10 tools
Tools are mostly distinct: image vs video generation, sync vs async, and combined download operations. However, there is some overlap between generate_image_async+get_async_result and generate_image (sync), but descriptions clarify usage.
Names follow a mostly consistent verb_noun pattern (e.g., list_models, generate_image). A minor inconsistency: 'get_async_result' is ambiguous (could be image or video), but the complementary 'get_video_result' helps. Compound names like 'generate_and_download_image' break the pattern slightly.
10 tools cover the core workflows for image and video generation without being excessive. Each tool has a clear purpose, and the number is well-scoped for the domain.
Covers essential operations: model listing, generation (sync/async), result retrieval, and download. Lacks a synchronous video generation option and management tools (e.g., list/cancel tasks), but the main generation pipeline is complete.
Maintenance
Related MCP Connectors
MCP server for Qwen Image 3 AI image generation
MCP server for Hailuo (MiniMax) AI video generation
MCP server for Wan AI video generation
MCP server for MiniMax H3 multimodal video generation
Related MCP Servers
- AlicenseAqualityCmaintenanceMCP server for generating images and videos using Volcengine's Jimeng APIs, supporting text-to-image, image-to-image, multi-image fusion, text-to-video, and image-to-video.31MIT
- AlicenseAqualityDmaintenanceMCP server for generating images using Z.AI's glm-image model. Supports image generation with various sizes and qualities, and includes batch CLI functionality.16 npmMIT
- AlicenseBqualityCmaintenanceMCP server that provides image analysis, OCR text extraction, and image description using the GLM-4V Flash model from Zhipu AI.38MIT
- FlicenseNot gradedqualityCmaintenanceMCP server for generating images via Zhipu CogView, supporting synchronous and asynchronous generation with progress notifications, plus health check endpoints.-