update-tasklist
Modify the title of an existing task list in Google Tasks by specifying the task list ID and the new title. Simplifies task list management through direct integration with Google Tasks.
Instructions
Update an existing task list
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tasklist | Yes | Task list ID | |
| title | Yes | New title for the task list |
Implementation Reference
- src/index.ts:347-400 (handler)Complete inline implementation of the 'update-tasklist' tool, including registration, input schema (tasklist ID and title), and handler function that checks authentication, calls Google Tasks API to update the tasklist title, and returns success/error response.server.tool( "update-tasklist", "Update an existing task list", { tasklist: z.string().describe("Task list ID"), title: z.string().describe("New title for the task list"), }, async ({ tasklist, title }) => { if (!isAuthenticated()) { return { isError: true, content: [ { type: "text", text: "Not authenticated. Please use the 'authenticate' tool first.", }, ], }; } try { const response = await tasks.tasklists.update({ tasklist, requestBody: { title, }, }); return { content: [ { type: "text", text: `Task list updated successfully:\n\n${JSON.stringify( response.data, null, 2 )}`, }, ], }; } catch (error) { console.error("Error updating task list:", error); return { isError: true, content: [ { type: "text", text: `Error updating task list: ${error}`, }, ], }; } } );
- src/index.ts:350-353 (schema)Zod input schema defining parameters for the update-tasklist tool: tasklist (string ID) and title (new title string).{ tasklist: z.string().describe("Task list ID"), title: z.string().describe("New title for the task list"), },
- src/index.ts:347-347 (registration)Registration of the 'update-tasklist' tool using server.tool, specifying name, description, schema, and handler.server.tool(