Skip to main content
Glama
avclabs

@avclabs.ai/enhance-mcp

Official
by avclabs

create_task

Initiate an asynchronous video enhancement task by providing a video source (URL or local file) and selecting a target resolution.

Instructions

创建视频增强任务(异步)

支持两种上传方式:

  1. URL 上传:提供视频 URL

  2. 本地上传:提供本地文件路径,MCP Server 自动上传到 TOS 对象存储

参数说明:

  • video_source: 视频 URL 或本地文件路径

  • type: "url" 或 "local"

  • resolution: 目标分辨率

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
video_sourceYes视频URL地址或本地文件路径
typeNo上传类型:url=网络视频,local=本地文件url
resolutionNo目标分辨率,默认720p720p

Implementation Reference

  • Zod schema for create_task tool input validation: defines video_source (string), type (enum: url/local, default: url), and resolution (enum: 480p/540p/720p/1080p/2k, default: 720p)
    const CreateTaskSchema = z.object({
      video_source: z.string().describe('视频URL地址或本地文件路径'),
      type: z.enum(['url', 'local']).default('url').describe('上传类型:url=网络视频,local=本地文件'),
      resolution: z.enum(['480p', '540p', '720p', '1080p', '2k']).default('720p').describe('目标分辨率,默认720p'),
    });
  • src/server.ts:90-131 (registration)
    Registration of the 'create_task' tool with MCP server, including its description, schema reference, and async handler that delegates to this.createTask()
        // create_task tool
        this.server.tool(
          'create_task',
          `创建视频增强任务(异步)
    
    支持两种上传方式:
    1. URL 上传:提供视频 URL
    2. 本地上传:提供本地文件路径,MCP Server 自动上传到 TOS 对象存储
    
    参数说明:
    - video_source: 视频 URL 或本地文件路径
    - type: "url" 或 "local"
    - resolution: 目标分辨率`,
          CreateTaskSchema.shape,
          async (args) => {
            try {
              const result = await this.createTask(
                args.video_source,
                args.type,
                args.resolution
              );
              return {
                content: [
                  {
                    type: 'text',
                    text: JSON.stringify(result, null, 2),
                  },
                ],
              };
            } catch (error) {
              const errorMessage = error instanceof Error ? error.message : String(error);
              return {
                content: [
                  {
                    type: 'text',
                    text: JSON.stringify({ success: false, error: errorMessage }, null, 2),
                  },
                ],
              };
            }
          }
        );
  • Core handler logic for create_task: handles local file upload (check file, get TOS signature, upload to TOS) or URL upload, then sends POST request to /api/v3/contents/generations/tasks to create the enhancement task
    private async createTask(
      videoSource: string,
      sourceType: string,
      resolution: string
    ): Promise<any> {
      let contentItem: any;
    
      if (sourceType === 'local') {
        // 本地上传:检查文件、获取 TOS 签名、直传文件
        const fileInfo = this.checkLocalFile(videoSource);
        const signatureData = await this.getTosSignature(fileInfo.fileName);
        await this.uploadToTos(videoSource, signatureData);
        const fileId = this.parseFileIdFromUrl(signatureData.url);
        contentItem = {
          type: 'video_file',
          file_id: fileId,
          file_name: fileInfo.fileName,
        };
      } else {
        // URL 上传
        contentItem = {
          type: 'video_url',
          video_url: { url: videoSource },
        };
      }
    
      const payload = {
        model: 'avc-enhance',
        content: [contentItem],
        resolution,
      };
    
      const response = await this.client.post('/api/v3/contents/generations/tasks', payload);
      const data = response.data;
    
      if (data.code !== 0 && data.code !== 200) {
        return { success: false, error: data.message };
      }
    
      return {
        success: true,
        task_id: data.data.task_id,
        status: data.data.status,
      };
    }
Behavior2/5

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

With no annotations, the description carries full burden. It notes the task is async, but fails to mention authentication needs, rate limits, or the return format (e.g., task ID). It also does not disclose any side effects or failure behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Description uses bullet points and is relatively concise. Each paragraph serves a purpose, though some wording could be tightened.

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?

The description explains the async nature and upload methods, but it lacks return value details (no output schema) and does not mention error cases or post-creation steps. Given the tool's complexity, it is minimally adequate.

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

Parameters4/5

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

Schema coverage is 100% and the description adds value by explaining that local files are automatically uploaded to TOS storage, which is not in the schema. It also summarizes parameter meanings clearly.

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 creates an asynchronous video enhancement task and lists two upload methods. It implicitly differentiates from the sibling 'enhance_video_sync' which is synchronous, but does not explicitly name the sibling.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explains the two upload methods and parameter defaults, but does not provide explicit guidance on when to use this tool versus siblings, nor does it state prerequisites or exclusions.

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/avclabs/enhance-mcp'

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