list-tasklists
Retrieve all task lists from Google Tasks to view, organize, or manage your tasks through Claude's interface.
Instructions
List all task lists
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:188-242 (registration)Registration of the 'list-tasklists' tool with inline handler implementation that lists all task lists from Google Tasks API after checking authentication.server.tool("list-tasklists", "List all task lists", {}, async () => { if (!isAuthenticated()) { return { isError: true, content: [ { type: "text", text: "Not authenticated. Please use the 'authenticate' tool first.", }, ], }; } try { const response = await tasks.tasklists.list(); const taskLists = response.data.items || []; if (taskLists.length === 0) { return { content: [ { type: "text", text: "No task lists found.", }, ], }; } const formattedLists = taskLists.map((list) => ({ id: list.id, title: list.title, updated: list.updated, })); return { content: [ { type: "text", text: JSON.stringify(formattedLists, null, 2), }, ], }; } catch (error) { console.error("Error listing task lists:", error); return { isError: true, content: [ { type: "text", text: `Error listing task lists: ${error}`, }, ], }; } });
- src/index.ts:188-242 (handler)The handler function for 'list-tasklists' tool: authenticates, calls tasks.tasklists.list(), formats the response, and returns JSON or appropriate error messages.server.tool("list-tasklists", "List all task lists", {}, async () => { if (!isAuthenticated()) { return { isError: true, content: [ { type: "text", text: "Not authenticated. Please use the 'authenticate' tool first.", }, ], }; } try { const response = await tasks.tasklists.list(); const taskLists = response.data.items || []; if (taskLists.length === 0) { return { content: [ { type: "text", text: "No task lists found.", }, ], }; } const formattedLists = taskLists.map((list) => ({ id: list.id, title: list.title, updated: list.updated, })); return { content: [ { type: "text", text: JSON.stringify(formattedLists, null, 2), }, ], }; } catch (error) { console.error("Error listing task lists:", error); return { isError: true, content: [ { type: "text", text: `Error listing task lists: ${error}`, }, ], }; } });
- src/index.ts:188-188 (schema)Empty schema object indicating no input parameters required for the tool.server.tool("list-tasklists", "List all task lists", {}, async () => {