Skip to main content
Glama
arpitbatra123

Google Tasks MCP Server

get-task

Retrieve a specific task by its ID from a designated task list using the Google Tasks MCP Server, enabling efficient task management through the Claude interface.

Instructions

Get a specific task by ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
taskYesTask ID
tasklistYesTask list ID

Implementation Reference

  • The handler function for the 'get-task' tool. It checks if the user is authenticated, then retrieves the specific task from the Google Tasks API using the provided tasklist and task IDs, returning the task data as JSON or an error message.
    async ({ tasklist, task }) => { if (!isAuthenticated()) { return { isError: true, content: [ { type: "text", text: "Not authenticated. Please use the 'authenticate' tool first.", }, ], }; } try { const response = await tasks.tasks.get({ tasklist, task, }); return { content: [ { type: "text", text: JSON.stringify(response.data, null, 2), }, ], }; } catch (error) { console.error("Error getting task:", error); return { isError: true, content: [ { type: "text", text: `Error getting task: ${error}`, }, ], }; } }
  • Input schema for the 'get-task' tool using Zod validation for tasklist and task parameters.
    { tasklist: z.string().describe("Task list ID"), task: z.string().describe("Task ID"), },
  • src/index.ts:542-589 (registration)
    The registration of the 'get-task' tool on the MCP server, including name, description, input schema, and inline handler function.
    server.tool( "get-task", "Get a specific task by ID", { tasklist: z.string().describe("Task list ID"), task: z.string().describe("Task ID"), }, async ({ tasklist, task }) => { if (!isAuthenticated()) { return { isError: true, content: [ { type: "text", text: "Not authenticated. Please use the 'authenticate' tool first.", }, ], }; } try { const response = await tasks.tasks.get({ tasklist, task, }); return { content: [ { type: "text", text: JSON.stringify(response.data, null, 2), }, ], }; } catch (error) { console.error("Error getting task:", error); return { isError: true, content: [ { type: "text", text: `Error getting task: ${error}`, }, ], }; } } );

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

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