Skip to main content
Glama
arpitbatra123

Google Tasks MCP Server

complete-task

Mark specific tasks as completed in Google Tasks by providing the task list ID and task ID through the Google Tasks MCP Server interface.

Instructions

Mark a task as completed

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
taskYesTask ID to mark as completed
tasklistYesTask list ID

Implementation Reference

  • The main handler function for the 'complete-task' tool. It checks authentication, retrieves the task, updates its status to 'completed' with a timestamp, calls the tasks.update API, and returns success or error response.
    async ({ tasklist, task }) => { if (!isAuthenticated()) { return { isError: true, content: [ { type: "text", text: "Not authenticated. Please use the 'authenticate' tool first.", }, ], }; } try { // Get the current task const currentTask = await tasks.tasks.get({ tasklist, task, }); // Update the status to completed const requestBody = { ...currentTask.data, status: "completed", completed: new Date().toISOString(), }; const response = await tasks.tasks.update({ tasklist, task, requestBody, }); return { content: [ { type: "text", text: `Task marked as completed:\n\n${JSON.stringify( response.data, null, 2 )}`, }, ], }; } catch (error) { console.error("Error completing task:", error); return { isError: true, content: [ { type: "text", text: `Error completing task: ${error}`, }, ], }; } }
  • Zod schema defining the input parameters: tasklist (string) and task (string).
    { tasklist: z.string().describe("Task list ID"), task: z.string().describe("Task ID to mark as completed"), },
  • src/index.ts:789-855 (registration)
    The server.tool registration call for the 'complete-task' tool, including name, description, schema, and inline handler.
    // 6. Complete a task server.tool( "complete-task", "Mark a task as completed", { tasklist: z.string().describe("Task list ID"), task: z.string().describe("Task ID to mark as completed"), }, async ({ tasklist, task }) => { if (!isAuthenticated()) { return { isError: true, content: [ { type: "text", text: "Not authenticated. Please use the 'authenticate' tool first.", }, ], }; } try { // Get the current task const currentTask = await tasks.tasks.get({ tasklist, task, }); // Update the status to completed const requestBody = { ...currentTask.data, status: "completed", completed: new Date().toISOString(), }; const response = await tasks.tasks.update({ tasklist, task, requestBody, }); return { content: [ { type: "text", text: `Task marked as completed:\n\n${JSON.stringify( response.data, null, 2 )}`, }, ], }; } catch (error) { console.error("Error completing task:", error); return { isError: true, content: [ { type: "text", text: `Error completing task: ${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