update_metadata
Modify metadata for tasks in the Divide and Conquer MCP Server by updating tags, priority levels, and estimated completion times to streamline task management.
Instructions
Updates the task metadata.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| estimated_completion_time | No | Estimated completion time (ISO timestamp or duration) | |
| priority | No | Priority level of the task | |
| tags | No | Tags to categorize the task |
Implementation Reference
- src/index.ts:1046-1086 (handler)The core handler function that implements the 'update_metadata' tool logic. It reads the current task data, conditionally updates metadata fields (tags, priority, estimated_completion_time), persists changes via writeTaskData, and returns a standardized MCP response.private async updateMetadata(args: any): Promise<any> { try { const taskData = await this.readTaskData(); // Update the metadata if (args.tags !== undefined) { taskData.metadata.tags = args.tags; } if (args.priority !== undefined) { taskData.metadata.priority = args.priority; } if (args.estimated_completion_time !== undefined) { taskData.metadata.estimated_completion_time = args.estimated_completion_time; } // Write the updated task data to the file await this.writeTaskData(taskData); return { content: [ { type: 'text', text: 'Metadata updated successfully.', }, ], }; } catch (error) { console.error('Error updating metadata:', error); return { content: [ { type: 'text', text: `Error updating metadata: ${error instanceof Error ? error.message : String(error)}`, }, ], isError: true, }; } }
- src/index.ts:360-384 (registration)Tool registration in the tools array passed to server.setTools(). Defines the tool name, description, and input schema for 'update_metadata'.{ name: 'update_metadata', description: 'Updates the task metadata.', inputSchema: { type: 'object', properties: { tags: { type: 'array', items: { type: 'string' }, description: 'Tags to categorize the task' }, priority: { type: 'string', enum: ['high', 'medium', 'low'], description: 'Priority level of the task' }, estimated_completion_time: { type: 'string', description: 'Estimated completion time (ISO timestamp or duration)' } } } },
- src/index.ts:446-447 (registration)Dispatch routing in the CallToolRequest handler switch statement. Routes calls to the 'update_metadata' tool to its handler method.case 'update_metadata': return await this.updateMetadata(request.params.arguments);
- src/index.ts:363-382 (schema)Input schema definition for the 'update_metadata' tool, specifying properties for tags (array of strings), priority (enum), and estimated_completion_time (string).inputSchema: { type: 'object', properties: { tags: { type: 'array', items: { type: 'string' }, description: 'Tags to categorize the task' }, priority: { type: 'string', enum: ['high', 'medium', 'low'], description: 'Priority level of the task' }, estimated_completion_time: { type: 'string', description: 'Estimated completion time (ISO timestamp or duration)' } }