Skip to main content
Glama
arpitbatra123

Google Tasks MCP Server

get-tasklist

Retrieve a specific Google Tasks list by its ID to view or manage tasks within that list through Claude.

Instructions

Get a task list by ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tasklistYesTask list ID

Implementation Reference

  • Full implementation of the 'get-tasklist' tool. Registers the tool with server.tool, defines the input schema using Zod, and provides the handler function that checks authentication, calls the Google Tasks API to retrieve the specific task list by ID, and returns the formatted JSON response or an error message.
    server.tool( "get-tasklist", "Get a task list by ID", { 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 { const response = await tasks.tasklists.get({ tasklist, }); return { content: [ { type: "text", text: JSON.stringify(response.data, null, 2), }, ], }; } catch (error) { console.error("Error getting task list:", error); return { isError: true, content: [ { type: "text", text: `Error getting task list: ${error}`, }, ], }; } } );
  • Zod input schema for the 'get-tasklist' tool, requiring a 'tasklist' string parameter which is the ID of the task list to retrieve.
    { tasklist: z.string().describe("Task list ID"), },
  • Helper function used by the 'get-tasklist' handler (and other tools) to check if the OAuth credentials are set, ensuring the user is authenticated before API calls.
    function isAuthenticated() { return credentials !== null; }

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