google_tasks_list_tasklists
Retrieve and manage all available task lists from Google Tasks using the MCP protocol, enabling integration with AI clients for streamlined task organization.
Instructions
List all available task lists
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- handlers/tasks.ts:30-42 (handler)The handler function that executes the core logic for the 'google_tasks_list_tasklists' tool. It validates the input arguments using isListTaskListsArgs and calls the GoogleTasks instance's listTaskLists method.export async function handleTasksListTasklists( args: any, googleTasksInstance: GoogleTasks ) { if (!isListTaskListsArgs(args)) { throw new Error("Invalid arguments for google_tasks_list_tasklists"); } const result = await googleTasksInstance.listTaskLists(); return { content: [{ type: "text", text: result }], isError: false, }; }
- server-setup.ts:218-222 (registration)The registration/dispatch point in the MCP server's call tool handler switch statement, which routes calls to this tool name to the specific handler function.case "google_tasks_list_tasklists": return await tasksHandlers.handleTasksListTasklists( args, googleTasksInstance );
- tools/tasks/index.ts:18-25 (schema)The schema definition for the tool, specifying name, description, and input schema (no required parameters).export const LIST_TASKLISTS_TOOL: Tool = { name: "google_tasks_list_tasklists", description: "List all available task lists", inputSchema: { type: "object", properties: {}, }, };
- utils/helper.ts:323-325 (helper)Input validation helper function used by the handler to check if arguments match the expected empty object schema.export function isListTaskListsArgs(args: any): args is Record<string, never> { return args && Object.keys(args).length === 0; }
- utils/tasks.ts:17-37 (helper)The underlying implementation in GoogleTasks class that performs the actual Google Tasks API call to list tasklists and formats the response.async listTaskLists() { try { const response = await this.tasks.tasklists.list({ maxResults: 100, }); if (!response.data.items || response.data.items.length === 0) { return "No task lists found."; } return response.data.items .map((list: any) => `${list.title} - ID: ${list.id}`) .join("\n"); } catch (error) { throw new Error( `Failed to list task lists: ${ error instanceof Error ? error.message : String(error) }` ); } }