todoist_delete_section
Remove a specific section from Todoist by providing its unique section ID. This tool simplifies section management within the Enhanced Todoist MCP Server Extended.
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)The handler logic for the todoist_delete_section tool. Validates input using isSectionIdArgs type guard, deletes the section using Todoist API client, and returns a 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)The Tool object definition for todoist_delete_section, including name, description, and input schema requiring a 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:1104-1108 (registration)Registration of the todoist_delete_section tool (DELETE_SECTION_TOOL) in the list of available tools returned by ListToolsRequestSchema handler.GET_SECTIONS_TOOL, CREATE_SECTION_TOOL, UPDATE_SECTION_TOOL, DELETE_SECTION_TOOL, // Label tools
- src/index.ts:902-911 (helper)Type guard function used to validate the arguments for the todoist_delete_section tool, ensuring sectionId is a string.function isSectionIdArgs(args: unknown): args is { sectionId: string; } { return ( typeof args === "object" && args !== null && "sectionId" in args && typeof (args as { sectionId: string }).sectionId === "string" ); }