todoist_delete_section
Remove sections from Todoist projects by specifying the section ID to organize tasks and maintain project structure.
Instructions
Delete a section by its ID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sectionId | Yes | The ID of the section to delete |
Implementation Reference
- src/index.ts:1518-1532 (handler)Handler for 'todoist_delete_section' tool: validates input using isSectionIdArgs, calls todoistClient.deleteSection(sectionId), and returns success message.if (name === "todoist_delete_section") { if (!isSectionIdArgs(args)) { throw new Error("Invalid arguments for todoist_delete_section"); } await todoistClient.deleteSection(args.sectionId); return { content: [{ type: "text", text: `Section ${args.sectionId} deleted successfully` }], isError: false, }; }
- src/index.ts:542-555 (schema)Tool schema definition for 'todoist_delete_section', specifying input schema requiring 'sectionId'.const DELETE_SECTION_TOOL: Tool = { name: "todoist_delete_section", description: "Delete a section by its ID", inputSchema: { type: "object", properties: { sectionId: { type: "string", description: "The ID of the section to delete" } }, required: ["sectionId"] } };
- src/index.ts:1103-1108 (registration)Registration of DELETE_SECTION_TOOL in the list of tools returned by ListToolsRequestSchema handler.// Section tools GET_SECTIONS_TOOL, CREATE_SECTION_TOOL, UPDATE_SECTION_TOOL, DELETE_SECTION_TOOL, // Label tools
- src/index.ts:902-911 (helper)Type guard helper 'isSectionIdArgs' used to validate arguments in the delete section handler.function isSectionIdArgs(args: unknown): args is { sectionId: string; } { return ( typeof args === "object" && args !== null && "sectionId" in args && typeof (args as { sectionId: string }).sectionId === "string" ); }