delete_image
Remove images from the BookStack gallery by specifying the image ID to manage visual content and maintain organized documentation.
Instructions
Delete an image from the gallery
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Image ID |
Implementation Reference
- src/tools/search-user-tools.ts:519-523 (handler)The main handler for the delete_image tool, which parses the image ID from arguments and delegates to the BookStack client's deleteImage method.case "delete_image": { const id = parseInteger(args.id); await client.deleteImage(id); return `Image ${id} deleted successfully`; }
- Input schema definition for the delete_image tool, specifying that an image ID (number) is required.{ name: "delete_image", description: "Delete an image from the gallery", inputSchema: { type: "object", properties: { id: { type: "number", description: "Image ID" }, }, required: ["id"], }, },
- src/tools/search-user-tools.ts:315-326 (registration)The delete_image tool is registered here as part of the search and user tools array returned by createSearchAndUserTools.{ name: "delete_image", description: "Delete an image from the gallery", inputSchema: { type: "object", properties: { id: { type: "number", description: "Image ID" }, }, required: ["id"], }, }, ];
- src/lib/bookstack-client.ts:413-415 (helper)Helper method in BookStackClient that performs the actual API DELETE request to remove the image from the gallery.async deleteImage(id: number): Promise<void> { return this.delete(`/image-gallery/${id}`); }
- src/index.ts:124-127 (registration)Tool dispatch registration in the main server handler, routing delete_image calls (included in searchUserToolNames) to handleSearchAndUserTool.if (contentToolNames.includes(name)) { result = await handleContentTool(name, args, bookStackClient); } else if (searchUserToolNames.includes(name)) { result = await handleSearchAndUserTool(name, args, bookStackClient);