delete_book
Remove a book from the BookStack wiki by moving it to the recycle bin using its unique ID.
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 the handleContentTool switch statement. Parses the book ID from arguments, calls the BookStackClient's deleteBook method, and returns a success message.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)Input schema definition for the 'delete_book' tool, specifying that a numeric 'id' parameter is required.{ 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)Supporting helper method in BookStackClient that sends a DELETE request to the BookStack API endpoint `/books/{id}` to delete the book.async deleteBook(id: number): Promise<void> { return this.delete(`/books/${id}`); }
- src/index.ts:124-126 (registration)Registration and dispatch logic in the main CallToolRequestSchema handler. Checks if the tool name is in contentToolNames (which includes 'delete_book') and routes to handleContentTool.if (contentToolNames.includes(name)) { result = await handleContentTool(name, args, bookStackClient); } else if (searchUserToolNames.includes(name)) {
- src/index.ts:81-81 (registration)'delete_book' listed in the contentToolNames array used for routing tool calls to the content tools handler."delete_book",