Skip to main content
Glama

batchProcess

Automate video editing tasks with a single command. Clip, merge, or split multiple videos in bulk using predefined configurations, saving time and effort through streamlined batch processing.

Instructions

批量处理视频任务

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tasksYes批量任务配置数组

Implementation Reference

  • MCP tool handler for 'batchProcess'. Receives batch tasks, adds them to BatchManager queue via addTasks(), and returns task IDs with confirmation message.
    private async handleBatchProcess(args: MCPToolParams['batchProcess']) { const taskIds = this.batchManager.addTasks(args.tasks); const result: MCPToolResults['batchProcess'] = { taskIds, message: `已添加 ${taskIds.length} 个批量任务到处理队列` }; return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], }; }
  • Tool registration in getToolDefinitions(). Defines name, description, and input schema for the batchProcess tool.
    { name: 'batchProcess', description: '批量处理视频任务', inputSchema: { type: 'object', properties: { tasks: { type: 'array', items: { type: 'object', properties: { type: { type: 'string', enum: ['clip', 'merge', 'split'], description: '任务类型' }, options: { type: 'object', description: '任务参数' } }, required: ['type', 'options'] }, description: '批量任务配置数组' } }, required: ['tasks'] } },
  • TypeScript type definition for batchProcess input parameters (MCPToolParams).
    batchProcess: { tasks: Omit<BatchTask, 'id' | 'status' | 'createdAt'>[]; };
  • TypeScript type definition for batchProcess output result (MCPToolResults).
    batchProcess: { taskIds: string[]; message: string; };
  • Core helper method in BatchManager that creates task entries, adds to processing queue, triggers processQueue(), and returns task IDs. This implements the batch queuing logic called by the handler.
    public addTasks(taskConfigs: Omit<BatchTask, 'id' | 'status' | 'createdAt'>[]): string[] { const taskIds: string[] = []; for (const config of taskConfigs) { const taskId = uuidv4(); const task: BatchTask = { id: taskId, type: config.type, options: config.options, status: 'pending', createdAt: new Date() }; this.tasks.set(taskId, task); this.processingQueue.push(taskId); taskIds.push(taskId); } // 开始处理队列 this.processQueue(); return taskIds; }

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/pickstar-2002/video-clip-mcp'

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