create-tasklist
Generate a new task list with a specified title using the Google Tasks MCP Server. Simplify task organization directly through the Claude interface.
Instructions
Create a new task list
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| title | Yes | Title of the new task list |
Implementation Reference
- src/index.ts:299-343 (handler)Handler function that checks authentication, calls Google Tasks API to insert a new tasklist with the given title, and returns success or error response.async ({ title }) => { if (!isAuthenticated()) { return { isError: true, content: [ { type: "text", text: "Not authenticated. Please use the 'authenticate' tool first.", }, ], }; } try { const response = await tasks.tasklists.insert({ requestBody: { title, }, }); return { content: [ { type: "text", text: `Task list created successfully:\n\n${JSON.stringify( response.data, null, 2 )}`, }, ], }; } catch (error) { console.error("Error creating task list:", error); return { isError: true, content: [ { type: "text", text: `Error creating task list: ${error}`, }, ], }; } }
- src/index.ts:296-298 (schema)Zod input schema defining the 'title' parameter for the tool.{ title: z.string().describe("Title of the new task list"), },
- src/index.ts:293-344 (registration)Registration of the 'create-tasklist' tool with McpServer, including name, description, input schema, and handler.server.tool( "create-tasklist", "Create a new task list", { title: z.string().describe("Title of the new task list"), }, async ({ title }) => { if (!isAuthenticated()) { return { isError: true, content: [ { type: "text", text: "Not authenticated. Please use the 'authenticate' tool first.", }, ], }; } try { const response = await tasks.tasklists.insert({ requestBody: { title, }, }); return { content: [ { type: "text", text: `Task list created successfully:\n\n${JSON.stringify( response.data, null, 2 )}`, }, ], }; } catch (error) { console.error("Error creating task list:", error); return { isError: true, content: [ { type: "text", text: `Error creating task list: ${error}`, }, ], }; } } );
- src/index.ts:46-49 (helper)Helper function to check if user is authenticated by verifying if credentials are set.// Helper function to check if authenticated function isAuthenticated() { return credentials !== null; }