delete_shelf
Remove a shelf from BookStack by moving it to the recycle bin using its ID. This action helps manage content organization by eliminating unused or outdated shelves.
Instructions
Delete a shelf (moves to recycle bin)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Shelf ID |
Implementation Reference
- src/tools/content-tools.ts:767-771 (handler)Handler logic for the 'delete_shelf' tool within the handleContentTool switch statement. It parses the shelf ID from arguments, calls the BookStackClient.deleteShelf method, and returns a success message.case "delete_shelf": { const id = parseInteger(args.id); await client.deleteShelf(id); return `Shelf ${id} deleted successfully`; }
- src/tools/content-tools.ts:525-535 (registration)Tool registration/definition for 'delete_shelf' returned by createContentTools function. Includes name, description, and input schema requiring a numeric shelf ID.{ name: "delete_shelf", description: "Delete a shelf (moves to recycle bin)", inputSchema: { type: "object", properties: { id: { type: "number", description: "Shelf ID" }, }, required: ["id"], }, },
- src/lib/bookstack-client.ts:278-280 (helper)Supporting helper method in BookStackClient class that performs the actual HTTP DELETE request to the BookStack API endpoint `/shelves/${id}` to delete the shelf.async deleteShelf(id: number): Promise<void> { return this.delete(`/shelves/${id}`); }
- src/index.ts:76-100 (registration)MCP server dispatch registration: 'delete_shelf' is listed in contentToolNames array, routing calls to handleContentTool in the CallToolRequestSchema handler.const contentToolNames = [ "list_books", "get_book", "create_book", "update_book", "delete_book", "export_book", "list_chapters", "get_chapter", "create_chapter", "update_chapter", "delete_chapter", "export_chapter", "list_pages", "get_page", "create_page", "update_page", "delete_page", "export_page", "list_shelves", "get_shelf", "create_shelf", "update_shelf", "delete_shelf", ];