update_metadata
Modify task metadata including priority, tags, and estimated completion time to organize and track progress in complex task breakdowns.
Instructions
Updates the task metadata.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "update_metadata"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tags | No | Tags to categorize the task | |
| priority | No | Priority level of the task | |
| estimated_completion_time | No | Estimated completion time (ISO timestamp or duration) |
Implementation Reference
- src/index.ts:1046-1086 (handler)The main handler function for the 'update_metadata' tool. Reads current task data from config file, conditionally updates metadata fields (tags, priority, estimated_completion_time) based on input arguments, persists changes by calling writeTaskData, and returns a standardized MCP response with success or error message.
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 ListToolsRequestSchema handler. Defines the tool name, description, and inputSchema which validates optional updates to tags (array of strings), priority (enum: high/medium/low), and estimated_completion_time (string).
{ 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)Routing case in the CallToolRequestSchema switch statement that dispatches 'update_metadata' calls to the private updateMetadata handler method.
case 'update_metadata': return await this.updateMetadata(request.params.arguments);