Skip to main content
Glama
arpitbatra123

Google Tasks MCP Server

update-task

Modify task details in Google Tasks, including title, notes, status, and due date, using the task list and task IDs for precise updates.

Instructions

Update an existing task

Input Schema

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

Implementation Reference

  • The main handler function that checks authentication, fetches the current task, merges updates, calls Google Tasks API to update, and returns success or error response.
    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 schema for input validation of the update-task tool parameters.
    { 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-738 (registration)
    MCP server tool registration for 'update-task', specifying name, 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}`, }, ], }; } } );

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