Skip to main content
Glama
arpitbatra123

Google Tasks MCP Server

clear-completed-tasks

Remove all completed tasks from a Google Tasks list to maintain organization and focus on pending items.

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 Google Tasks API, handles errors.
    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}`,
            },
          ],
        };
      }
    }
  • Zod input schema defining the 'tasklist' parameter as a string.
    {
      tasklist: z.string().describe("Task list ID"),
    },
  • src/index.ts:922-967 (registration)
    Registration of the 'clear-completed-tasks' tool on the MCP server with name, description, schema, and handler.
    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}`,
              },
            ],
          };
        }
      }
    );
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the action ('Clear') which implies a destructive mutation, but lacks details on permissions required, whether the operation is reversible, rate limits, or what the response looks like (e.g., success confirmation or error handling). This is a significant gap for a mutation tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with zero waste. It's front-loaded with the core action and resource, making it easy to parse quickly without unnecessary elaboration.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given this is a mutation tool with no annotations and no output schema, the description is incomplete. It doesn't explain behavioral aspects like safety, permissions, or response format, which are critical for an agent to use it correctly. The high schema coverage helps with parameters, but overall context is lacking.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, with the single parameter 'tasklist' documented as 'Task list ID'. The description doesn't add any parameter-specific details beyond this, such as format examples or constraints. Baseline 3 is appropriate since the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Clear') and resource ('completed tasks from a task list'), making the purpose understandable. However, it doesn't explicitly differentiate from sibling tools like 'delete-task' or 'delete-tasklist' which might handle different deletion scenarios, so it doesn't reach the highest score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing a task list ID), exclusions (e.g., what happens to incomplete tasks), or comparisons to siblings like 'delete-task' for individual deletions, leaving usage ambiguous.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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