complete_task
Mark a task as completed by providing its ID to update task status in the Task MCP Server.
Instructions
Mark a task as completed
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"task_id": "<task_id>"
},
"name": "complete_task"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| task_id | Yes | ID of the task to complete |
Implementation Reference
- src/task_mcp_server/server.py:123-140 (handler)Executes the complete_task tool: retrieves task_id from arguments, checks if task exists, marks it as completed, and returns a success message.
elif name == "complete_task": task_id = int(arguments.get("task_id", 0)) if task_id not in tasks: return [ types.TextContent( type="text", text=f"❌ Task {task_id} not found" ) ] tasks[task_id]["completed"] = True return [ types.TextContent( type="text", text=f"✅ Task {task_id} marked as completed: {tasks[task_id]['title']}" ) ] - src/task_mcp_server/server.py:44-57 (registration)Registers the 'complete_task' tool in the list_tools handler, including its name, description, and input schema requiring a numeric task_id.
types.Tool( name="complete_task", description="Mark a task as completed", inputSchema={ "type": "object", "properties": { "task_id": { "type": "number", "description": "ID of the task to complete" } }, "required": ["task_id"] } ), - src/task_mcp_server/server.py:44-57 (schema)Defines the input schema for the complete_task tool, specifying an object with a required numeric 'task_id' property.
types.Tool( name="complete_task", description="Mark a task as completed", inputSchema={ "type": "object", "properties": { "task_id": { "type": "number", "description": "ID of the task to complete" } }, "required": ["task_id"] } ),