Skip to main content
Glama
arpitbatra123

Google Tasks MCP Server

list-tasks

Retrieve and display all tasks from a specified task list, with options to include completed, hidden, or deleted tasks, using the Google Tasks MCP Server integration.

Instructions

List all tasks in a task list

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
showCompletedNoWhether to include completed tasks
showDeletedNoWhether to include deleted tasks
showHiddenNoWhether to include hidden tasks
tasklistYesTask list ID

Implementation Reference

  • Handler function that authenticates the user, fetches tasks from Google Tasks API using tasks.tasks.list(), formats them, and returns as JSON or error messages.
    async ({ tasklist, showCompleted = true, showHidden = false, showDeleted = false, }) => { if (!isAuthenticated()) { return { isError: true, content: [ { type: "text", text: "Not authenticated. Please use the 'authenticate' tool first.", }, ], }; } try { const response: any = await tasks.tasks.list({ tasklist, showCompleted, showHidden, showDeleted, }); const tasksResponse = response.data.items || []; if (tasksResponse.length === 0) { return { content: [ { type: "text", text: "No tasks found in this list.", }, ], }; } const formattedTasks = tasksResponse.map((task: any) => ({ id: task.id, title: task.title, status: task.status, due: task.due, notes: task.notes, completed: task.completed, })); return { content: [ { type: "text", text: JSON.stringify(formattedTasks, null, 2), }, ], }; } catch (error) { console.error("Error listing tasks:", error); return { isError: true, content: [ { type: "text", text: `Error listing tasks: ${error}`, }, ], }; } }
  • Zod input schema defining parameters for the list-tasks tool: required tasklist ID and optional flags for showing completed, hidden, and deleted tasks.
    { tasklist: z.string().describe("Task list ID"), showCompleted: z .boolean() .optional() .describe("Whether to include completed tasks"), showHidden: z .boolean() .optional() .describe("Whether to include hidden tasks"), showDeleted: z .boolean() .optional() .describe("Whether to include deleted tasks"), },
  • src/index.ts:452-539 (registration)
    Full registration of the 'list-tasks' tool on the MCP server using server.tool(), including name, description, input schema, and inline handler function.
    server.tool( "list-tasks", "List all tasks in a task list", { tasklist: z.string().describe("Task list ID"), showCompleted: z .boolean() .optional() .describe("Whether to include completed tasks"), showHidden: z .boolean() .optional() .describe("Whether to include hidden tasks"), showDeleted: z .boolean() .optional() .describe("Whether to include deleted tasks"), }, async ({ tasklist, showCompleted = true, showHidden = false, showDeleted = false, }) => { if (!isAuthenticated()) { return { isError: true, content: [ { type: "text", text: "Not authenticated. Please use the 'authenticate' tool first.", }, ], }; } try { const response: any = await tasks.tasks.list({ tasklist, showCompleted, showHidden, showDeleted, }); const tasksResponse = response.data.items || []; if (tasksResponse.length === 0) { return { content: [ { type: "text", text: "No tasks found in this list.", }, ], }; } const formattedTasks = tasksResponse.map((task: any) => ({ id: task.id, title: task.title, status: task.status, due: task.due, notes: task.notes, completed: task.completed, })); return { content: [ { type: "text", text: JSON.stringify(formattedTasks, null, 2), }, ], }; } catch (error) { console.error("Error listing tasks:", error); return { isError: true, content: [ { type: "text", text: `Error listing tasks: ${error}`, }, ], }; } } );

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