update_context
Modifies context information for all tasks on the Divide and Conquer MCP Server to ensure consistent and up-to-date task execution and tracking.
Instructions
Updates the context information for all tasks.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| context_for_all_tasks | Yes | The new context information for all tasks |
Implementation Reference
- src/index.ts:640-674 (handler)The primary handler function implementing the logic for the 'update_context' tool. It reads the current task data from file, updates the context_for_all_tasks field with the provided argument, writes the updated data back to file, and returns a success or error response.private async updateContext(args: any): Promise<any> { if (!args?.context_for_all_tasks) { throw new McpError(ErrorCode.InvalidParams, 'Context for all tasks is required'); } try { const taskData = await this.readTaskData(); // Update the context for all tasks taskData.context_for_all_tasks = args.context_for_all_tasks; // Write the updated task data to the file await this.writeTaskData(taskData); return { content: [ { type: 'text', text: 'Context updated successfully.', }, ], }; } catch (error) { console.error('Error updating context:', error); return { content: [ { type: 'text', text: `Error updating context: ${error instanceof Error ? error.message : String(error)}`, }, ], isError: true, }; } }
- src/index.ts:192-201 (schema)The input schema defining the parameters for the 'update_context' tool: requires a 'context_for_all_tasks' string.inputSchema: { type: 'object', properties: { context_for_all_tasks: { type: 'string', description: 'The new context information for all tasks' } }, required: ['context_for_all_tasks'] }
- src/index.ts:428-429 (registration)The switch case in the CallToolRequestSchema handler that dispatches calls to the 'update_context' tool to its handler function.case 'update_context': return await this.updateContext(request.params.arguments);
- src/index.ts:189-202 (registration)The tool registration entry in the ListToolsRequestSchema response, including name, description, and schema.{ name: 'update_context', description: 'Updates the context information for all tasks.', inputSchema: { type: 'object', properties: { context_for_all_tasks: { type: 'string', description: 'The new context information for all tasks' } }, required: ['context_for_all_tasks'] } },