delete_image
Remove an image from the BookStack gallery by specifying its unique ID to manage and clean up visual content within your wiki instance.
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)Handler logic for the 'delete_image' tool: parses the image ID from arguments, calls the BookStack client's deleteImage method, and returns a success message.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 object with a required 'id' property of type number is expected.{ name: "delete_image", description: "Delete an image from the gallery", inputSchema: { type: "object", properties: { id: { type: "number", description: "Image ID" }, }, required: ["id"], }, },
- src/index.ts:56-59 (registration)Registration of the 'delete_image' tool (via createSearchAndUserTools) in the complete list of tools returned by the MCP server's listTools handler.const allTools: Tool[] = [ ...createContentTools(bookStackClient), ...createSearchAndUserTools(bookStackClient), ];
- src/index.ts:124-128 (registration)Dispatch logic in the MCP callTool handler that routes 'delete_image' calls (listed 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); } else {
- src/lib/bookstack-client.ts:413-415 (helper)BookStackClient helper method that executes the actual DELETE API request to remove the image from the gallery.async deleteImage(id: number): Promise<void> { return this.delete(`/image-gallery/${id}`); }