next_task
Retrieve and mark the next highest priority task as in-progress using the MCP Think Tank server, ensuring efficient task management and focused execution.
Instructions
Get the next highest priority todo task and mark it as in-progress.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| random_string | No | Dummy parameter for no-parameter tools |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"random_string": {
"description": "Dummy parameter for no-parameter tools",
"type": "string"
}
},
"type": "object"
}
Implementation Reference
- src/tasks/tools.ts:133-158 (handler)The execute handler for the next_task tool. Retrieves the highest priority 'todo' task from taskStorage, marks it as 'in-progress', and returns the updated task.execute: async () => { try { const nextTask = taskStorage.getHighestPriority("todo"); if (!nextTask) { return JSON.stringify({ message: "No todo tasks found", task: null }); } // Update task status to in-progress const updatedTask = taskStorage.update(nextTask.id, { status: "in-progress" }); return JSON.stringify({ task: updatedTask, message: "Task marked as in-progress" }); } catch (error) { return JSON.stringify({ error: `Failed to get next task: ${error instanceof Error ? error.message : String(error)}` }); } }
- src/tasks/tools.ts:130-159 (registration)Registers the 'next_task' tool with the FastMCP server instance in the registerTaskTools function.server.addTool({ name: "next_task", description: "Get the next highest priority todo task and mark it as in-progress.", execute: async () => { try { const nextTask = taskStorage.getHighestPriority("todo"); if (!nextTask) { return JSON.stringify({ message: "No todo tasks found", task: null }); } // Update task status to in-progress const updatedTask = taskStorage.update(nextTask.id, { status: "in-progress" }); return JSON.stringify({ task: updatedTask, message: "Task marked as in-progress" }); } catch (error) { return JSON.stringify({ error: `Failed to get next task: ${error instanceof Error ? error.message : String(error)}` }); } } });