Skip to main content
Glama

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
NameRequiredDescriptionDefault
context_for_all_tasksYesThe new context information for all tasks

Implementation Reference

  • 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, }; } }
  • 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'] } },

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/landicefu/divide-and-conquer-mcp-server'

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