Skip to main content
Glama

delete_attachment

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

Instructions

Delete an attachment

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesAttachment ID

Implementation Reference

  • Executes the 'delete_attachment' MCP tool: parses the attachment ID from input arguments, invokes 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`;
    }
  • Tool schema definition specifying the name, description, and input schema (requiring a numeric 'id' for the attachment).
    {
      name: "delete_attachment",
      description: "Delete an attachment",
      inputSchema: {
        type: "object",
        properties: {
          id: { type: "number", description: "Attachment ID" },
        },
        required: ["id"],
      },
    },
  • BookStackClient helper method that performs the actual HTTP DELETE request to the BookStack API endpoint `/attachments/{id}`.
    async deleteAttachment(id: number): Promise<void> {
      return this.delete(`/attachments/${id}`);
    }
  • src/index.ts:102-128 (registration)
    Registers 'delete_attachment' in the searchUserToolNames array for dispatch routing to the appropriate handler (handleSearchAndUserTool) in the MCP server's CallToolRequestSchema handler.
    // Search and user tools
    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 {
  • src/index.ts:56-66 (registration)
    Includes the 'delete_attachment' tool (via createSearchAndUserTools) in the allTools array advertised to MCP clients via ListToolsRequestSchema.
    const allTools: Tool[] = [
      ...createContentTools(bookStackClient),
      ...createSearchAndUserTools(bookStackClient),
    ];
    
    // List tools handler
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return {
        tools: allTools,
      };
    });
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. 'Delete an attachment' implies a destructive mutation, but it doesn't specify whether deletion is permanent, reversible, requires specific permissions, or has side effects (e.g., affecting linked resources). This leaves critical behavioral traits undocumented for a destructive operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise at three words, with zero wasted language. It's front-loaded with the core action and resource, making it easy to parse. For a simple delete operation, this brevity is appropriate rather than under-specified.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's destructive nature, lack of annotations, and no output schema, the description is incomplete. It doesn't address behavioral risks, success/failure responses, or contextual nuances (e.g., what an 'attachment' is in this system). For a mutation tool with zero structured safety hints, more descriptive context is needed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage (the 'id' parameter is documented as 'Attachment ID'), so the baseline is 3. The description doesn't add any parameter details beyond what the schema provides, but with only one required parameter and full schema coverage, this is minimally adequate. A score of 4 reflects that the tool is simple enough that extensive parameter explanation isn't necessary.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Delete an attachment' clearly states the verb (delete) and resource (attachment), making the basic purpose understandable. However, it doesn't differentiate from sibling tools like delete_book, delete_chapter, or delete_image, which all follow the same 'delete [resource]' pattern without clarifying what distinguishes an attachment from other deletable resources.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing the attachment ID), exclusions, or relationships with sibling tools like get_attachment or list_attachments. The agent must infer usage from the name alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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