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
| Name | Required | Description | Default |
|---|---|---|---|
| tasklist | Yes | Task list ID |
Implementation Reference
- src/index.ts:245-290 (handler)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}`, }, ], }; } } );
- src/index.ts:248-250 (schema)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"), },
- src/index.ts:47-49 (helper)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; }