Skip to main content
Glama
arpitbatra123

Google Tasks MCP Server

move-task

Relocate a task within a Google Tasks list by specifying its new position, parent task, or sibling task using the MCP server integration for efficient task management.

Instructions

Move a task to another position

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
parentNoOptional new parent task ID
previousNoOptional previous sibling task ID
taskYesTask ID to move
tasklistYesTask list ID

Implementation Reference

  • Handler function that implements the move-task tool logic: checks authentication, constructs move parameters, calls the tasks API to move the task, and formats success or error response.
    async ({ tasklist, task, parent, previous }) => { if (!isAuthenticated()) { return { isError: true, content: [ { type: "text", text: "Not authenticated. Please use the 'authenticate' tool first.", }, ], }; } try { const moveParams: any = { tasklist, task, }; if (parent !== undefined) moveParams.parent = parent; if (previous !== undefined) moveParams.previous = previous; const response = await tasks.tasks.move(moveParams); return { content: [ { type: "text", text: `Task moved successfully:\n\n${JSON.stringify( response.data, null, 2 )}`, }, ], }; } catch (error) { console.error("Error moving task:", error); return { isError: true, content: [ { type: "text", text: `Error moving task: ${error}`, }, ], }; } }
  • Input schema for move-task tool using Zod validation: requires tasklist and task IDs, optional parent and previous sibling IDs.
    tasklist: z.string().describe("Task list ID"), task: z.string().describe("Task ID to move"), parent: z.string().optional().describe("Optional new parent task ID"), previous: z .string() .optional() .describe("Optional previous sibling task ID"), },
  • src/index.ts:858-919 (registration)
    Registration of the 'move-task' tool on the MCP server, specifying name, description, input schema, and handler function.
    server.tool( "move-task", "Move a task to another position", { tasklist: z.string().describe("Task list ID"), task: z.string().describe("Task ID to move"), parent: z.string().optional().describe("Optional new parent task ID"), previous: z .string() .optional() .describe("Optional previous sibling task ID"), }, async ({ tasklist, task, parent, previous }) => { if (!isAuthenticated()) { return { isError: true, content: [ { type: "text", text: "Not authenticated. Please use the 'authenticate' tool first.", }, ], }; } try { const moveParams: any = { tasklist, task, }; if (parent !== undefined) moveParams.parent = parent; if (previous !== undefined) moveParams.previous = previous; const response = await tasks.tasks.move(moveParams); return { content: [ { type: "text", text: `Task moved successfully:\n\n${JSON.stringify( response.data, null, 2 )}`, }, ], }; } catch (error) { console.error("Error moving task:", error); return { isError: true, content: [ { type: "text", text: `Error moving 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