Skip to main content
Glama
arpitbatra123

Google Tasks MCP Server

update-task

Modify existing Google Tasks by updating title, notes, status, or due date to keep task information current and accurate.

Instructions

Update an existing task

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tasklistYesTask list ID
taskYesTask ID
titleNoNew title for the task
notesNoNew notes for the task
statusNoStatus of the task
dueNoDue date in RFC 3339 format (e.g., 2025-03-19T12:00:00Z)

Implementation Reference

  • The handler function that implements the logic for updating an existing task in a Google Tasks list. It fetches the current task, merges updates, and calls the Google Tasks API update method.
    async ({ tasklist, task, title, notes, status, due }) => { if (!isAuthenticated()) { return { isError: true, content: [ { type: "text", text: "Not authenticated. Please use the 'authenticate' tool first.", }, ], }; } try { // First, get the current task data const currentTask = await tasks.tasks.get({ tasklist, task, }); // Prepare the update request const requestBody: any = { ...currentTask.data, }; if (title !== undefined) requestBody.title = title; if (notes !== undefined) requestBody.notes = notes; if (status !== undefined) requestBody.status = status; if (due !== undefined) requestBody.due = due; const response = await tasks.tasks.update({ tasklist, task, requestBody, }); return { content: [ { type: "text", text: `Task updated successfully:\n\n${JSON.stringify( response.data, null, 2 )}`, }, ], }; } catch (error) { console.error("Error updating task:", error); return { isError: true, content: [ { type: "text", text: `Error updating task: ${error}`, }, ], }; } }
  • Zod input schema defining parameters for the update-task tool: required tasklist and task IDs, optional title, notes, status, and due date.
    tasklist: z.string().describe("Task list ID"), task: z.string().describe("Task ID"), title: z.string().optional().describe("New title for the task"), notes: z.string().optional().describe("New notes for the task"), status: z .enum(["needsAction", "completed"]) .optional() .describe("Status of the task"), due: z .string() .optional() .describe("Due date in RFC 3339 format (e.g., 2025-03-19T12:00:00Z)"), },
  • src/index.ts:659-737 (registration)
    The server.tool registration call that defines and registers the 'update-task' tool with its description, input schema, and handler function.
    server.tool( "update-task", "Update an existing task", { tasklist: z.string().describe("Task list ID"), task: z.string().describe("Task ID"), title: z.string().optional().describe("New title for the task"), notes: z.string().optional().describe("New notes for the task"), status: z .enum(["needsAction", "completed"]) .optional() .describe("Status of the task"), due: z .string() .optional() .describe("Due date in RFC 3339 format (e.g., 2025-03-19T12:00:00Z)"), }, async ({ tasklist, task, title, notes, status, due }) => { if (!isAuthenticated()) { return { isError: true, content: [ { type: "text", text: "Not authenticated. Please use the 'authenticate' tool first.", }, ], }; } try { // First, get the current task data const currentTask = await tasks.tasks.get({ tasklist, task, }); // Prepare the update request const requestBody: any = { ...currentTask.data, }; if (title !== undefined) requestBody.title = title; if (notes !== undefined) requestBody.notes = notes; if (status !== undefined) requestBody.status = status; if (due !== undefined) requestBody.due = due; const response = await tasks.tasks.update({ tasklist, task, requestBody, }); return { content: [ { type: "text", text: `Task updated successfully:\n\n${JSON.stringify( response.data, null, 2 )}`, }, ], }; } catch (error) { console.error("Error updating task:", error); return { isError: true, content: [ { type: "text", text: `Error updating task: ${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/arpitbatra123/mcp-googletasks'

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