Skip to main content
Glama

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
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • 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, }; }
  • 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 );
  • 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: {}, }, };
  • 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; }
  • 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) }` ); } }

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/vakharwalad23/google-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server