update
Modify multiple upcoming tasks (starting from a specified ID) by applying new context or changes described in the prompt. Suitable for batch updates in task management systems.
Instructions
Update multiple upcoming tasks (with ID >= 'from' ID) based on new context or changes provided in the prompt. Use 'update_task' instead for a single specific task or 'update_subtask' for subtasks.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | No | Path to the tasks file relative to project root | |
| from | Yes | Task ID from which to start updating (inclusive). IMPORTANT: This tool uses 'from', not 'id' | |
| projectRoot | No | The directory of the project. (Optional, usually from session) | |
| prompt | Yes | Explanation of changes or new context to apply | |
| research | No | Use Perplexity AI for research-backed updates | |
| tag | No | Tag context to operate on |
Implementation Reference
- mcp-server/src/tools/update.js:20-107 (registration)The registerUpdateTool function that adds the 'update' tool to the MCP server, including name, description, parameters schema, and execute handler.export function registerUpdateTool(server) { server.addTool({ name: 'update', description: "Update multiple upcoming tasks (with ID >= 'from' ID) based on new context or changes provided in the prompt. Use 'update_task' instead for a single specific task or 'update_subtask' for subtasks.", parameters: z.object({ from: z .string() .describe( "Task ID from which to start updating (inclusive). IMPORTANT: This tool uses 'from', not 'id'" ), prompt: z .string() .describe('Explanation of changes or new context to apply'), research: z .boolean() .optional() .describe('Use Perplexity AI for research-backed updates'), file: z .string() .optional() .describe('Path to the tasks file relative to project root'), projectRoot: z .string() .optional() .describe( 'The directory of the project. (Optional, usually from session)' ), tag: z.string().optional().describe('Tag context to operate on') }), execute: withNormalizedProjectRoot(async (args, { log, session }) => { const toolName = 'update'; const { from, prompt, research, file, projectRoot, tag } = args; const resolvedTag = resolveTag({ projectRoot: args.projectRoot, tag: args.tag }); try { log.info( `Executing ${toolName} tool with normalized root: ${projectRoot}` ); let tasksJsonPath; try { tasksJsonPath = findTasksPath({ projectRoot, file }, log); log.info(`${toolName}: Resolved tasks path: ${tasksJsonPath}`); } catch (error) { log.error(`${toolName}: Error finding tasks.json: ${error.message}`); return createErrorResponse( `Failed to find tasks.json within project root '${projectRoot}': ${error.message}` ); } const result = await updateTasksDirect( { tasksJsonPath: tasksJsonPath, from: from, prompt: prompt, research: research, projectRoot: projectRoot, tag: resolvedTag }, log, { session } ); log.info( `${toolName}: Direct function result: success=${result.success}` ); return handleApiResult({ result, log: log, errorPrefix: 'Error updating tasks', projectRoot: args.projectRoot }); } catch (error) { log.error( `Critical error in ${toolName} tool execute: ${error.message}` ); return createErrorResponse( `Internal tool error (${toolName}): ${error.message}` ); } }) }); }
- mcp-server/src/tools/update.js:50-104 (handler)The core execute handler for the 'update' tool. Normalizes project root, resolves tasks path, calls updateTasksDirect core function, and handles response.execute: withNormalizedProjectRoot(async (args, { log, session }) => { const toolName = 'update'; const { from, prompt, research, file, projectRoot, tag } = args; const resolvedTag = resolveTag({ projectRoot: args.projectRoot, tag: args.tag }); try { log.info( `Executing ${toolName} tool with normalized root: ${projectRoot}` ); let tasksJsonPath; try { tasksJsonPath = findTasksPath({ projectRoot, file }, log); log.info(`${toolName}: Resolved tasks path: ${tasksJsonPath}`); } catch (error) { log.error(`${toolName}: Error finding tasks.json: ${error.message}`); return createErrorResponse( `Failed to find tasks.json within project root '${projectRoot}': ${error.message}` ); } const result = await updateTasksDirect( { tasksJsonPath: tasksJsonPath, from: from, prompt: prompt, research: research, projectRoot: projectRoot, tag: resolvedTag }, log, { session } ); log.info( `${toolName}: Direct function result: success=${result.success}` ); return handleApiResult({ result, log: log, errorPrefix: 'Error updating tasks', projectRoot: args.projectRoot }); } catch (error) { log.error( `Critical error in ${toolName} tool execute: ${error.message}` ); return createErrorResponse( `Internal tool error (${toolName}): ${error.message}` ); }
- mcp-server/src/tools/update.js:25-48 (schema)Zod schema defining the input parameters for the 'update' tool: from, prompt, research, file, projectRoot, tag.parameters: z.object({ from: z .string() .describe( "Task ID from which to start updating (inclusive). IMPORTANT: This tool uses 'from', not 'id'" ), prompt: z .string() .describe('Explanation of changes or new context to apply'), research: z .boolean() .optional() .describe('Use Perplexity AI for research-backed updates'), file: z .string() .optional() .describe('Path to the tasks file relative to project root'), projectRoot: z .string() .optional() .describe( 'The directory of the project. (Optional, usually from session)' ), tag: z.string().optional().describe('Tag context to operate on')
- mcp-server/src/tools/tool-registry.js:77-77 (registration)Entry in the central toolRegistry mapping the 'update' tool name to its registration function registerUpdateTool.update: registerUpdateTool,