Skip to main content
Glama

google_tasks_get_task

Retrieve specific task details by providing the task ID and optional task list ID from Google Tasks. Integrates with Google MCP for AI client compatibility.

Instructions

Get details about a specific task

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
taskIdYesID of the task to retrieve
taskListIdNoID of the task list the task belongs to (uses default if not specified)

Implementation Reference

  • Main handler function for 'google_tasks_get_task' tool. Validates input arguments, extracts taskId and taskListId, calls the GoogleTasks instance's getTask method, and formats the response.
    export async function handleTasksGetTask(
      args: any,
      googleTasksInstance: GoogleTasks
    ) {
      if (!isGetTaskArgs(args)) {
        throw new Error("Invalid arguments for google_tasks_get_task");
      }
      const { taskId, taskListId } = args;
      const result = await googleTasksInstance.getTask(taskId, taskListId);
      return {
        content: [{ type: "text", text: result }],
        isError: false,
      };
    }
  • Tool definition including name, description, and inputSchema for 'google_tasks_get_task'.
    export const GET_TASK_TOOL: Tool = {
      name: "google_tasks_get_task",
      description: "Get details about a specific task",
      inputSchema: {
        type: "object",
        properties: {
          taskId: {
            type: "string",
            description: "ID of the task to retrieve",
          },
          taskListId: {
            type: "string",
            description:
              "ID of the task list the task belongs to (uses default if not specified)",
          },
        },
        required: ["taskId"],
      },
    };
  • Registration in the switch statement that dispatches tool calls to the specific handler function.
    case "google_tasks_get_task":
      return await tasksHandlers.handleTasksGetTask(
        args,
        googleTasksInstance
      );
  • Type guard function used for input validation in the handler (isGetTaskArgs).
    export function isGetTaskArgs(args: any): args is {
      taskId: string;
      taskListId?: string;
    } {
      return (
        args &&
        typeof args.taskId === "string" &&
        (args.taskListId === undefined || typeof args.taskListId === "string")
      );
    }
  • Core implementation in GoogleTasks class: fetches the task using Google API, formats the output with title, ID, status, due date, completion date, and notes.
      async getTask(taskId: string, taskListId?: string) {
        try {
          const targetTaskList = taskListId || this.defaultTaskList;
          const response = await this.tasks.tasks.get({
            tasklist: targetTaskList,
            task: taskId,
          });
    
          const task = response.data;
          const due = task.due ? `Due: ${new Date(task.due).toLocaleString()}` : "";
          const completed = task.completed
            ? `Completed: ${new Date(task.completed).toLocaleString()}`
            : "";
          const status = task.status || "";
    
          return `Task: ${task.title}
    ID: ${task.id}
    Status: ${status}
    ${due}
    ${completed}
    ${task.notes ? `Notes: ${task.notes}` : ""}`;
        } catch (error) {
          throw new Error(
            `Failed to get task: ${
              error instanceof Error ? error.message : String(error)
            }`
          );
        }
      }
Behavior2/5

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

With no annotations provided, the description carries full burden but only states the basic action without behavioral details. It doesn't disclose if this is a read-only operation (implied but not explicit), authentication requirements, rate limits, error handling, or what 'details' include (e.g., metadata, status). For a tool with zero annotation coverage, this is insufficient.

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 front-loads the core purpose ('Get details about a specific task') with zero wasted words. It's appropriately sized for a simple retrieval tool, making it easy for an agent to parse quickly.

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 no annotations, no output schema, and a simple input schema, the description is incomplete. It doesn't explain what 'details' are returned (e.g., task properties, status), potential errors, or behavioral constraints. For a tool in a context with sibling mutation tools, more guidance is needed to ensure correct agent usage.

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%, so the schema already documents both parameters ('taskId' and 'taskListId') with clear descriptions. The description adds no additional parameter semantics beyond implying retrieval by ID, which aligns with the schema. Baseline 3 is appropriate as 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 verb ('Get') and resource ('details about a specific task'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'google_tasks_list_tasks' or 'google_tasks_complete_task', which would require mentioning it retrieves a single task by ID rather than listing multiple tasks or modifying them.

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?

No guidance is provided on when to use this tool versus alternatives. The description doesn't mention prerequisites (e.g., needing a task ID), contrast with 'google_tasks_list_tasks' for multiple tasks, or specify scenarios like retrieving task metadata versus content. This leaves the agent without contextual usage cues.

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

Related 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/vakharwalad23/google-mcp'

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