Skip to main content
Glama

plan_task

Register user requests and organize tasks with subtasks, dependencies, and notes using TaskFlow MCP. Enable structured workflows, track progress, and ensure user approval at each step for efficient task management.

Instructions

Register a new user request and plan its associated tasks. You must provide 'originalRequest' and 'tasks', and optionally 'splitDetails'.

Tasks can now include subtasks, which are smaller units of work that make up a task. All subtasks must be completed before a task can be marked as done.

You can also include:

  • 'dependencies': List of project or task-specific dependencies (libraries, tools, etc.)

  • 'notes': General notes about the project (preferences, guidelines, etc.)

  • 'outputPath': Path to save a Markdown file with the task plan for reference. It's recommended to use absolute paths (e.g., 'C:/Users/username/Documents/task-plan.md') rather than relative paths for more reliable file creation.

This tool initiates a new workflow for handling a user's request. The workflow is as follows:

  1. Use 'plan_task' to register a request and its tasks (with optional subtasks, dependencies, and notes).

  2. After adding tasks, you MUST use 'get_next_task' to retrieve the first task. A progress table will be displayed.

  3. Use 'get_next_task' to retrieve the next uncompleted task.

  4. If the task has subtasks, complete each subtask using 'mark_subtask_done' before marking the task as done.

  5. IMPORTANT: After marking a task as done, a progress table will be displayed showing the updated status of all tasks. The assistant MUST NOT proceed to another task without the user's approval. The user must explicitly approve the completed task.

  6. Once a task is approved, you can proceed to 'get_next_task' again to fetch the next pending task.

  7. Repeat this cycle until all tasks are done.

  8. After all tasks are completed (and approved), 'get_next_task' will indicate that all tasks are done and that the request awaits approval for full completion.

  9. The user must then approve the entire request's completion. If the user does not approve and wants more tasks, you can again use 'plan_task' to add new tasks and continue the cycle.

The critical point is to always wait for user approval after completing each task and after all tasks are done, wait for request completion approval. Do not proceed automatically.

Input Schema

NameRequiredDescriptionDefault
dependenciesNo
notesNo
originalRequestYes
outputPathNo
splitDetailsNo
tasksYes

Input Schema (JSON Schema)

{ "properties": { "dependencies": { "items": { "properties": { "description": { "type": "string" }, "name": { "type": "string" }, "url": { "type": "string" }, "version": { "type": "string" } }, "required": [ "name" ], "type": "object" }, "type": "array" }, "notes": { "items": { "properties": { "content": { "type": "string" }, "title": { "type": "string" } }, "required": [ "title", "content" ], "type": "object" }, "type": "array" }, "originalRequest": { "type": "string" }, "outputPath": { "type": "string" }, "splitDetails": { "type": "string" }, "tasks": { "items": { "properties": { "dependencies": { "items": { "properties": { "description": { "type": "string" }, "name": { "type": "string" }, "url": { "type": "string" }, "version": { "type": "string" } }, "required": [ "name" ], "type": "object" }, "type": "array" }, "description": { "type": "string" }, "subtasks": { "items": { "properties": { "description": { "type": "string" }, "title": { "type": "string" } }, "required": [ "title", "description" ], "type": "object" }, "type": "array" }, "title": { "type": "string" } }, "required": [ "title", "description" ], "type": "object" }, "type": "array" } }, "required": [ "originalRequest", "tasks" ], "type": "object" }

Implementation Reference

  • The core handler function for the 'plan_task' tool. It extracts arguments from the input and delegates to the TaskFlowService.requestPlanning method to create a new request with tasks.
    async plan_task(args: any) { const { originalRequest, tasks, splitDetails, outputPath, dependencies, notes, } = args ?? {}; return service.requestPlanning( String(originalRequest), tasks ?? [], splitDetails, outputPath, dependencies, notes ); },
  • Input schema for the 'plan_task' tool, defining the structure and validation for parameters like originalRequest, tasks, dependencies, notes, etc.
    inputSchema: { type: "object", properties: { originalRequest: { type: "string" }, splitDetails: { type: "string" }, outputPath: { type: "string" }, dependencies: { type: "array", items: { type: "object", properties: { name: { type: "string" }, version: { type: "string" }, url: { type: "string" }, description: { type: "string" }, }, required: ["name"], }, }, notes: { type: "array", items: { type: "object", properties: { title: { type: "string" }, content: { type: "string" }, }, required: ["title", "content"], }, }, tasks: { type: "array", items: { type: "object", properties: { title: { type: "string" }, description: { type: "string" }, dependencies: { type: "array", items: { type: "object", properties: { name: { type: "string" }, version: { type: "string" }, url: { type: "string" }, description: { type: "string" }, }, required: ["name"], }, }, subtasks: { type: "array", items: { type: "object", properties: { title: { type: "string" }, description: { type: "string" }, }, required: ["title", "description"], }, }, }, required: ["title", "description"], }, }, }, required: ["originalRequest", "tasks"], },
  • Registration of the 'plan_task' tool (as PLAN_TASK_TOOL) in the MCP server's list of available tools, returned by the ListToolsRequest handler.
    tools: [ PLAN_TASK_TOOL, GET_NEXT_TASK_TOOL, MARK_TASK_DONE_TOOL, OPEN_TASK_DETAILS_TOOL, LIST_REQUESTS_TOOL, ADD_TASKS_TO_REQUEST_TOOL, UPDATE_TASK_TOOL, DELETE_TASK_TOOL, ADD_SUBTASKS_TOOL, MARK_SUBTASK_DONE_TOOL, UPDATE_SUBTASK_TOOL, DELETE_SUBTASK_TOOL, EXPORT_TASK_STATUS_TOOL, ADD_NOTE_TOOL, UPDATE_NOTE_TOOL, DELETE_NOTE_TOOL, ADD_DEPENDENCY_TOOL, GET_PROMPTS_TOOL, SET_PROMPTS_TOOL, UPDATE_PROMPTS_TOOL, REMOVE_PROMPTS_TOOL, ARCHIVE_COMPLETED_REQUESTS_TOOL, LIST_ARCHIVED_REQUESTS_TOOL, RESTORE_ARCHIVED_REQUEST_TOOL, ], }));
  • The taskflowHandlers function that creates the handler object for all tools, including 'plan_task', which is used by the server for dynamic dispatching.
    export function taskflowHandlers(service: TaskFlowService) { return { async plan_task(args: any) { const { originalRequest, tasks, splitDetails, outputPath, dependencies, notes, } = args ?? {}; return service.requestPlanning( String(originalRequest), tasks ?? [], splitDetails, outputPath, dependencies, notes ); }, async get_next_task(args: any) { return service.getNextTask(String(args.requestId)); }, async mark_task_done(args: any) { const { requestId, taskId, completedDetails } = args ?? {}; return service.markTaskDone(String(requestId), String(taskId), completedDetails); }, async open_task_details(args: any) { return service.openTaskDetails(String(args.taskId)); }, async list_requests() { return service.listRequests(); }, async add_tasks_to_request(args: any) { const { requestId, tasks } = args ?? {}; return service.addTasksToRequest(String(requestId), tasks ?? []); }, async update_task(args: any) { const { requestId, taskId, title, description } = args ?? {}; return service.updateTask(String(requestId), String(taskId), { title, description }); }, async delete_task(args: any) { const { requestId, taskId } = args ?? {}; return service.deleteTask(String(requestId), String(taskId)); }, async add_subtasks(args: any) { const { requestId, taskId, subtasks } = args ?? {}; return service.addSubtasks(String(requestId), String(taskId), subtasks ?? []); }, async mark_subtask_done(args: any) { const { requestId, taskId, subtaskId } = args ?? {}; return service.markSubtaskDone(String(requestId), String(taskId), String(subtaskId)); }, async update_subtask(args: any) { const { requestId, taskId, subtaskId, title, description } = args ?? {}; return service.updateSubtask(String(requestId), String(taskId), String(subtaskId), { title, description }); }, async delete_subtask(args: any) { const { requestId, taskId, subtaskId } = args ?? {}; return service.deleteSubtask(String(requestId), String(taskId), String(subtaskId)); }, async export_task_status(args: any) { const { requestId, outputPath, filename, format } = args ?? {}; return service.exportTaskStatus(String(requestId), outputPath, filename, format); }, async add_note(args: any) { const { requestId, title, content } = args ?? {}; return service.addNote(String(requestId), String(title), String(content)); }, async update_note(args: any) { const { requestId, noteId, title, content } = args ?? {}; return service.updateNote(String(requestId), String(noteId), { title, content }); }, async delete_note(args: any) { const { requestId, noteId } = args ?? {}; return service.deleteNote(String(requestId), String(noteId)); }, async add_dependency(args: any) { const { requestId, taskId, dependency } = args ?? {}; return service.addDependency(String(requestId), dependency, taskId ? String(taskId) : undefined); }, async get_prompts() { return service.getPrompts(); }, async set_prompts(args: any) { const { instructions, taskPrefix, taskSuffix } = args ?? {}; return service.setPrompts({ instructions, taskPrefix, taskSuffix }); }, async update_prompts(args: any) { const { instructions, taskPrefix, taskSuffix } = args ?? {}; return service.updatePrompts({ instructions, taskPrefix, taskSuffix }); }, async remove_prompts(args: any) { const { fields } = args ?? {}; return service.removePrompts(fields); }, async archive_completed_requests(args: any) { const { requestIds } = args ?? {}; return service.archiveCompletedRequests(requestIds); }, async list_archived_requests(args: any) { const { searchTerm, limit } = args ?? {}; return service.listArchivedRequests(searchTerm, limit); }, async restore_archived_request(args: any) { const { requestId } = args ?? {}; return service.restoreArchivedRequest(String(requestId)); }, } as const; }
  • JSON schema definition for 'plan_task' input in the centralized jsonSchemas object, matching the tool's inputSchema.
    plan_task: { type: "object", properties: { originalRequest: { type: "string" }, tasks: { type: "array", items: taskInputJson }, splitDetails: { type: "string" }, outputPath: { type: "string" }, dependencies: { type: "array", items: dependencyJson }, notes: { type: "array", items: noteJson }, }, required: ["originalRequest", "tasks"], },

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/pinkpixel-dev/taskflow-mcp'

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