delete_book
Remove a book from the BookStack wiki by moving it to the recycle bin using its unique ID number.
Instructions
Delete a book (moves to recycle bin)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Book ID |
Implementation Reference
- src/tools/content-tools.ts:581-585 (handler)Handler logic for the 'delete_book' tool within handleContentTool switch statement. Parses the book ID from arguments and delegates to BookStackClient.deleteBook.case "delete_book": { const id = parseInteger(args.id); await client.deleteBook(id); return `Book ${id} deleted successfully`; }
- src/tools/content-tools.ts:135-145 (schema)Tool schema definition for 'delete_book' including name, description, and input schema requiring a numeric book ID.{ name: "delete_book", description: "Delete a book (moves to recycle bin)", inputSchema: { type: "object", properties: { id: { type: "number", description: "Book ID" }, }, required: ["id"], }, },
- src/lib/bookstack-client.ts:106-108 (helper)BookStackClient helper method that performs the actual DELETE API request to /books/{id}.async deleteBook(id: number): Promise<void> { return this.delete(`/books/${id}`); }
- src/index.ts:56-59 (registration)Registration of content tools (including delete_book schema) into the allTools array used for ListTools response.const allTools: Tool[] = [ ...createContentTools(bookStackClient), ...createSearchAndUserTools(bookStackClient), ];
- src/index.ts:124-126 (registration)Dispatch registration in CallTool handler: routes 'delete_book' to handleContentTool based on contentToolNames inclusion.if (contentToolNames.includes(name)) { result = await handleContentTool(name, args, bookStackClient); } else if (searchUserToolNames.includes(name)) {