Skip to main content
Glama
arpitbatra123

Google Tasks MCP Server

create-task

Add new tasks to Google Tasks by specifying a task list ID, title, optional notes, and due date. Streamline task management directly through the MCP server interface.

Instructions

Create a new task in a task list

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dueNoDue date in RFC 3339 format (e.g., 2025-03-19T12:00:00Z)
notesNoNotes for the task
tasklistYesTask list ID
titleYesTitle of the task

Implementation Reference

  • The handler function that checks authentication, prepares the task request body, calls the Google Tasks API to insert the task, and returns the result or error.
    async ({ tasklist, title, notes, due }) => { if (!isAuthenticated()) { return { isError: true, content: [ { type: "text", text: "Not authenticated. Please use the 'authenticate' tool first.", }, ], }; } try { const requestBody: any = { title, status: "needsAction", }; if (notes) requestBody.notes = notes; if (due) requestBody.due = due; const response = await tasks.tasks.insert({ tasklist, requestBody, }); return { content: [ { type: "text", text: `Task created successfully:\n\n${JSON.stringify( response.data, null, 2 )}`, }, ], }; } catch (error) { console.error("Error creating task:", error); return { isError: true, content: [ { type: "text", text: `Error creating task: ${error}`, }, ], }; } } );
  • Zod input schema defining parameters for creating a task: required tasklist and title, optional notes and due date.
    { tasklist: z.string().describe("Task list ID"), title: z.string().describe("Title of the task"), notes: z.string().optional().describe("Notes for the task"), due: z .string() .optional() .describe("Due date in RFC 3339 format (e.g., 2025-03-19T12:00:00Z)"), },
  • src/index.ts:592-657 (registration)
    The server.tool registration call that defines the tool name, description, input schema, and handler function for the 'create-task' tool.
    server.tool( "create-task", "Create a new task in a task list", { tasklist: z.string().describe("Task list ID"), title: z.string().describe("Title of the task"), notes: z.string().optional().describe("Notes for the task"), due: z .string() .optional() .describe("Due date in RFC 3339 format (e.g., 2025-03-19T12:00:00Z)"), }, async ({ tasklist, title, notes, due }) => { if (!isAuthenticated()) { return { isError: true, content: [ { type: "text", text: "Not authenticated. Please use the 'authenticate' tool first.", }, ], }; } try { const requestBody: any = { title, status: "needsAction", }; if (notes) requestBody.notes = notes; if (due) requestBody.due = due; const response = await tasks.tasks.insert({ tasklist, requestBody, }); return { content: [ { type: "text", text: `Task created successfully:\n\n${JSON.stringify( response.data, null, 2 )}`, }, ], }; } catch (error) { console.error("Error creating task:", error); return { isError: true, content: [ { type: "text", text: `Error creating 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