complete_task
Mark a task as completed by providing its UUID, enhancing task management within the MCP Think Tank system for efficient problem-solving workflows.
Instructions
Mark a task as completed.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | UUID of the task to mark as completed |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"id": {
"description": "UUID of the task to mark as completed",
"format": "uuid",
"type": "string"
}
},
"required": [
"id"
],
"type": "object"
}
Implementation Reference
- src/tasks/tools.ts:162-192 (handler)The complete_task tool registration and handler implementation. Validates the task ID using CompleteTaskSchema, retrieves the task from storage, updates its status to 'done', and returns the result as JSON.server.addTool({ name: "complete_task", description: "Mark a task as completed.", execute: async (params: any) => { try { // Validate input parameters const validatedParams = CompleteTaskSchema.parse(params); const task = taskStorage.get(validatedParams.id); if (!task) { return JSON.stringify({ error: `Task with ID ${validatedParams.id} not found` }); } // Update task status to done const updatedTask = taskStorage.update(validatedParams.id, { status: "done" }); return JSON.stringify({ task: updatedTask, message: "Task marked as completed" }); } catch (error) { return JSON.stringify({ error: `Invalid complete_task parameters: ${error instanceof Error ? error.message : String(error)}` }); } } });
- src/tasks/tools.ts:32-35 (schema)Zod schema defining the input parameters for the complete_task tool: a required UUID string for the task ID.// Schema for complete_task parameters const CompleteTaskSchema = z.object({ id: z.string().uuid() });