delete_chapter
Remove a chapter by moving it to the recycle bin using its ID, enabling content management in BookStack wiki instances.
Instructions
Delete a chapter (moves to recycle bin)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Chapter ID |
Implementation Reference
- src/tools/content-tools.ts:643-647 (handler)The handler logic for the 'delete_chapter' tool within the handleContentTool function's switch statement. It parses the input ID, calls the BookStackClient's deleteChapter method, and returns a success message.case "delete_chapter": { const id = parseInteger(args.id); await client.deleteChapter(id); return `Chapter ${id} deleted successfully`; }
- src/tools/content-tools.ts:266-276 (schema)The Tool object definition in createContentTools, specifying the name, description, and input schema (requiring a numeric chapter ID) for the 'delete_chapter' tool.{ name: "delete_chapter", description: "Delete a chapter (moves to recycle bin)", inputSchema: { type: "object", properties: { id: { type: "number", description: "Chapter ID" }, }, required: ["id"], }, },
- src/lib/bookstack-client.ts:166-168 (helper)The BookStackClient method deleteChapter that performs the actual API DELETE request to /chapters/{id}, called by the tool handler.async deleteChapter(id: number): Promise<void> { return this.delete(`/chapters/${id}`); }
- src/index.ts:56-59 (registration)Registration of content tools (including 'delete_chapter' via createContentTools) into the allTools array, which is returned by the list tools handler.const allTools: Tool[] = [ ...createContentTools(bookStackClient), ...createSearchAndUserTools(bookStackClient), ];
- src/index.ts:87-87 (registration)Explicit inclusion of 'delete_chapter' in the contentToolNames array used to route tool calls to handleContentTool."delete_chapter",