Skip to main content
Glama
mstfe

Google Tasks MCP Server

by mstfe

complete_task

Mark tasks as completed or return to pending status in Google Tasks to track progress and manage workflow.

Instructions

Toggle the completion status of a task

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
taskIdYesID of the task to toggle completion status
statusNoStatus of task, needsAction or completed

Implementation Reference

  • Handler for the 'complete_task' tool: Validates arguments, extracts taskId and status, patches the task status via Google Tasks API, and returns the updated task data.
    if (request.params.name === "complete_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;
      const newStatus  = args.status;
    
      if (!taskId) {
        throw new McpError(
          ErrorCode.InvalidParams,
          "The 'taskId' field is required."
        );
      }
    
      try {
        // Durumu güncelle
        const updateResponse = await tasks.tasks.patch({
          tasklist: "@default",
          task: taskId,
          requestBody: { status: newStatus },
        });
    
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(updateResponse.data, null, 2),
            },
          ],
        };
      } catch (error) {
        throw new McpError(
          ErrorCode.InternalError,
          `Tasks API error: ${error}`
        );
      }
    }
  • src/index.ts:173-184 (registration)
    Tool registration in the list_tools response, defining name, description, and input schema for 'complete_task'.
    {
      name: "complete_task",
      description: "Toggle the completion status of a task",
      inputSchema: {
        type: "object",
        properties: {
          taskId: { type: "string", description: "ID of the task to toggle completion status" },
          status: { type: "string", description: "Status of task, needsAction or completed" },
        },
        required: ["taskId"],
      },
    },
  • Helper validation function used in the complete_task handler to check arguments (though originally for create_task).
    export function isValidCreateTaskArgs(args: any): args is CreateTaskArgs {
      return (
        typeof args === "object" &&
        args !== null &&
        (args.title === undefined || typeof args.title === "string") &&
        (args.notes === undefined || typeof args.notes === "string") &&
        (args.taskId === undefined || typeof args.taskId === "string") &&
        (args.status === undefined || typeof args.status === "string")
      );
    }
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 tool 'toggles' completion status, which implies a mutation operation, but doesn't specify whether this requires permissions, is reversible, has side effects, or what the response looks like. The description lacks details on rate limits, error conditions, or how the toggle interacts with the 'status' parameter, leaving behavioral traits unclear.

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 that directly states the tool's purpose without unnecessary words. It's front-loaded with the core action and resource, making it easy to parse. Every part of the sentence earns its place by conveying essential information concisely.

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 the tool's complexity (a mutation operation with 2 parameters), lack of annotations, and no output schema, the description is incomplete. It doesn't cover behavioral aspects like permissions, reversibility, or response format, nor does it provide usage context relative to siblings. For a mutation tool with no structured safety or output information, the description should do more to compensate.

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?

Schema description coverage is 100%, with clear descriptions for both parameters ('taskId' and 'status'). The description adds no additional meaning beyond what the schema provides—it doesn't explain parameter interactions, constraints, or usage examples. Since the schema does the heavy lifting, the baseline score of 3 is appropriate, as the description neither compensates for gaps nor adds value.

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 ('toggle') and resource ('completion status of a task'), making the purpose immediately understandable. It doesn't explicitly distinguish from siblings like 'create_task' or 'delete_task', but the verb 'toggle' implies a different operation than creation or deletion. The description avoids tautology by not just restating the name 'complete_task'.

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 like 'create_task' or 'delete_task'. It doesn't mention prerequisites (e.g., needing an existing task), exclusions, or contextual factors. While the action 'toggle' implies it modifies existing tasks, this is only implied rather than explicitly stated as usage guidance.

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/mstfe/mcp-google-tasks'

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