delete_task
Remove a specific task from your default task list by providing its unique ID. Integrates with Google Tasks API via the MCP server to manage tasks effectively.
Instructions
Delete a task from the default task list
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| taskId | Yes | ID of the task to delete |
Implementation Reference
- src/index.ts:245-280 (handler)Handler for the 'delete_task' tool. Validates arguments (misusing create_task validator), extracts taskId, calls Google Tasks API to delete the task, returns success message or throws errors.if (request.params.name === "delete_task") { if (!isValidCreateTaskArgs(request.params.arguments)) { throw new McpError( ErrorCode.InvalidParams, "Invalid arguments for creating a task. 'title' must be a string, and 'notes' must be a string or undefined." ); } const args = request.params.arguments; const taskId = args.taskId; if (!taskId) { throw new McpError( ErrorCode.InvalidParams, "The 'taskId' field is required." ); } try { await tasks.tasks.delete({ tasklist: "@default", task: taskId, }); return { content: [ { type: "text", text: "Task deleted successfully.", }, ], }; } catch (error) { throw new McpError( ErrorCode.InternalError, `Tasks API error: ${error}` ); } }
- src/index.ts:162-172 (registration)Registration of the 'delete_task' tool in the ListTools response, including its description and input schema requiring 'taskId'.{ name: "delete_task", description: "Delete a task from the default task list", inputSchema: { type: "object", properties: { taskId: { type: "string", description: "ID of the task to delete" }, }, required: ["taskId"], }, },