Skip to main content
Glama
arpitbatra123

Google Tasks MCP Server

get-tasklist

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

Instructions

Get a task list by ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tasklistYesTask list ID

Implementation Reference

  • The handler function for the 'get-tasklist' tool. It checks if the user is authenticated, fetches the task list by ID using the Google Tasks API, returns the task list data as JSON, or an error message if authentication fails or API call fails.
    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}`, }, ], }; } }
  • Input schema for the 'get-tasklist' tool using Zod, requiring a 'tasklist' parameter which is the ID of the task list to retrieve.
    { tasklist: z.string().describe("Task list ID"), },
  • src/index.ts:245-290 (registration)
    The server.tool registration call that registers the 'get-tasklist' tool with MCP server, including name, description, input schema, and handler function.
    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}`, }, ], }; } } );
  • Helper function used within the 'get-tasklist' handler to check if OAuth credentials are available (i.e., user is authenticated).
    function isAuthenticated() { return credentials !== null; }

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