Skip to main content
Glama

batchProcess

Process multiple video tasks simultaneously to clip, merge, or split files in bulk, saving time on repetitive video editing operations.

Instructions

批量处理视频任务

Input Schema

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

Implementation Reference

  • MCP tool handler for batchProcess: adds tasks to BatchManager queue and returns task IDs.
    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), }, ], }; }
  • Registration of batchProcess tool in getToolDefinitions(), including input schema.
    { 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 interface definition for batchProcess input parameters (MCPToolParams).
    // 批量处理工具参数 batchProcess: { tasks: Omit<BatchTask, 'id' | 'status' | 'createdAt'>[]; };
  • TypeScript interface definition for batchProcess output result (MCPToolResults).
    batchProcess: { taskIds: string[]; message: string; };
  • Core helper method addTasks in BatchManager that creates and queues batch tasks, triggers processing.
    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; }

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