todoist_update_section
Modify the name of an existing Todoist section by specifying its ID and new name, enabling efficient task organization and management within projects.
Instructions
Update an existing section
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | New name for the section | |
| sectionId | Yes | The ID of the section to update |
Implementation Reference
- src/index.ts:1502-1516 (handler)Handler logic for todoist_update_section: validates input with isUpdateSectionArgs and updates the section name using todoistClient.updateSectionif (name === "todoist_update_section") { if (!isUpdateSectionArgs(args)) { throw new Error("Invalid arguments for todoist_update_section"); } const updatedSection = await todoistClient.updateSection(args.sectionId, { name: args.name }); return { content: [{ type: "text", text: `Section updated successfully:\nID: ${updatedSection.id}\nName: ${updatedSection.name}` }], isError: false, }; }
- src/index.ts:523-540 (schema)Input schema and Tool metadata definition for todoist_update_sectionconst UPDATE_SECTION_TOOL: Tool = { name: "todoist_update_section", description: "Update an existing section", inputSchema: { type: "object", properties: { sectionId: { type: "string", description: "The ID of the section to update" }, name: { type: "string", description: "New name for the section" } }, required: ["sectionId", "name"] } };
- src/index.ts:888-900 (helper)Type guard helper function isUpdateSectionArgs used to validate tool argumentsfunction isUpdateSectionArgs(args: unknown): args is { sectionId: string; name: string; } { return ( typeof args === "object" && args !== null && "sectionId" in args && "name" in args && typeof (args as { sectionId: string; name: string }).sectionId === "string" && typeof (args as { sectionId: string; name: string }).name === "string" ); }
- src/index.ts:1083-1121 (registration)Registration of todoist_update_section (as UPDATE_SECTION_TOOL) in the list of tools returned by ListToolsRequestSchema handlerserver.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: [ // Task tools CREATE_TASK_TOOL, QUICK_ADD_TASK_TOOL, GET_TASKS_TOOL, GET_TASK_TOOL, UPDATE_TASK_TOOL, DELETE_TASK_TOOL, COMPLETE_TASK_TOOL, REOPEN_TASK_TOOL, SEARCH_TASKS_TOOL, MOVE_TASK_TOOL, BULK_MOVE_TASKS_TOOL, // Project tools GET_PROJECTS_TOOL, GET_PROJECT_TOOL, CREATE_PROJECT_TOOL, UPDATE_PROJECT_TOOL, DELETE_PROJECT_TOOL, // Section tools GET_SECTIONS_TOOL, CREATE_SECTION_TOOL, UPDATE_SECTION_TOOL, DELETE_SECTION_TOOL, // Label tools CREATE_LABEL_TOOL, GET_LABEL_TOOL, GET_LABELS_TOOL, UPDATE_LABEL_TOOL, DELETE_LABEL_TOOL, // Comment tools CREATE_COMMENT_TOOL, GET_COMMENT_TOOL, GET_COMMENTS_TOOL, UPDATE_COMMENT_TOOL, DELETE_COMMENT_TOOL, ], }));