Skip to main content
Glama
arpitbatra123

Google Tasks MCP Server

clear-completed-tasks

Remove all completed tasks from a specified task list in Google Tasks to maintain an organized and clutter-free workspace.

Instructions

Clear all completed tasks from a task list

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tasklistYesTask list ID

Implementation Reference

  • Handler function that implements the clear-completed-tasks tool logic: authenticates, clears completed tasks via tasks.tasks.clear, returns success or error response.
    async ({ tasklist }) => { if (!isAuthenticated()) { return { isError: true, content: [ { type: "text", text: "Not authenticated. Please use the 'authenticate' tool first.", }, ], }; } try { await tasks.tasks.clear({ tasklist, }); return { content: [ { type: "text", text: `All completed tasks in list '${tasklist}' have been cleared.`, }, ], }; } catch (error) { console.error("Error clearing completed tasks:", error); return { isError: true, content: [ { type: "text", text: `Error clearing completed tasks: ${error}`, }, ], }; } }
  • Input schema for the tool using Zod: requires 'tasklist' string.
    { tasklist: z.string().describe("Task list ID"), },
  • src/index.ts:922-967 (registration)
    Registration of the 'clear-completed-tasks' tool with server.tool, specifying name, description, input schema, and handler function.
    server.tool( "clear-completed-tasks", "Clear all completed tasks from a task list", { tasklist: z.string().describe("Task list ID"), }, async ({ tasklist }) => { if (!isAuthenticated()) { return { isError: true, content: [ { type: "text", text: "Not authenticated. Please use the 'authenticate' tool first.", }, ], }; } try { await tasks.tasks.clear({ tasklist, }); return { content: [ { type: "text", text: `All completed tasks in list '${tasklist}' have been cleared.`, }, ], }; } catch (error) { console.error("Error clearing completed tasks:", error); return { isError: true, content: [ { type: "text", text: `Error clearing completed tasks: ${error}`, }, ], }; } } );

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/arpitbatra123/mcp-googletasks'

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