Skip to main content
Glama

delete_attachment

Remove an attachment from BookStack by specifying its ID to manage wiki content and maintain organized documentation.

Instructions

Delete an attachment

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesAttachment ID

Implementation Reference

  • The handler function for the 'delete_attachment' MCP tool. It parses the input 'id' parameter, calls the BookStack client's deleteAttachment method, and returns a success message.
    case "delete_attachment": { const id = parseInteger(args.id); await client.deleteAttachment(id); return `Attachment ${id} deleted successfully`; }
  • The Tool definition including name, description, and inputSchema for the 'delete_attachment' tool, which is returned by createSearchAndUserTools and registered with the MCP server.
    { name: "delete_attachment", description: "Delete an attachment", inputSchema: { type: "object", properties: { id: { type: "number", description: "Attachment ID" }, }, required: ["id"], }, },
  • src/index.ts:103-128 (registration)
    Registration and dispatch logic in the main MCP server handler. Includes 'delete_attachment' in searchUserToolNames array and routes calls to handleSearchAndUserTool.
    const searchUserToolNames = [ "search_all", "list_users", "get_user", "create_user", "update_user", "delete_user", "list_roles", "get_role", "create_role", "update_role", "delete_role", "list_attachments", "get_attachment", "delete_attachment", "list_images", "get_image", "update_image", "delete_image", ]; if (contentToolNames.includes(name)) { result = await handleContentTool(name, args, bookStackClient); } else if (searchUserToolNames.includes(name)) { result = await handleSearchAndUserTool(name, args, bookStackClient); } else {
  • Helper method in BookStackClient that sends the DELETE request to the BookStack API endpoint `/attachments/{id}`.
    async deleteAttachment(id: number): Promise<void> { return this.delete(`/attachments/${id}`); }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/lautarobarba/bookstack_mcp_server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server