create-tasklist
Create a new task list in Google Tasks to organize and manage your to-do items through Claude's 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)The handler function for the 'create-tasklist' tool. It checks if the user is authenticated, then uses the Google Tasks API to insert a new tasklist with the given title, and returns a success message with the response data or an error message.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)Input schema for the 'create-tasklist' tool, defining a required 'title' parameter as a string.{ title: z.string().describe("Title of the new task list"), },
- src/index.ts:293-344 (registration)Registration of the 'create-tasklist' tool using server.tool(), specifying name, description, input schema, and inline handler function.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}`, }, ], }; } } );