Skip to main content
Glama

get_attachment

Retrieve details for a specific attachment in BookStack by providing its ID, enabling access to file information within the wiki system.

Instructions

Get details of a specific attachment

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesAttachment ID

Implementation Reference

  • Tool registration object for 'get_attachment', including name, description, and input schema that requires a numeric 'id' parameter.
    {
      name: "get_attachment",
      description: "Get details of a specific attachment",
      inputSchema: {
        type: "object",
        properties: {
          id: { type: "number", description: "Attachment ID" },
        },
        required: ["id"],
      },
    },
  • Input schema for the get_attachment tool, defining an object with a required numeric 'id' property.
    inputSchema: {
      type: "object",
      properties: {
        id: { type: "number", description: "Attachment ID" },
      },
      required: ["id"],
    },
  • Handler implementation for the get_attachment tool within the tool dispatcher. Parses the 'id' argument, calls BookStackClient.getAttachment(id), and returns a formatted response.
    case "get_attachment": {
      const id = parseInteger(args.id);
      const result = await client.getAttachment(id);
      return formatApiResponse(result);
    }
  • BookStackClient helper method that performs the actual API call to retrieve attachment details by ID from the BookStack server.
    async getAttachment(id: number): Promise<Attachment> {
      const response: AxiosResponse<Attachment> = await this.api.get(
        `/attachments/${id}`
      );
      return response.data;
    }
  • src/index.ts:56-66 (registration)
    Top-level registration where search-user-tools (containing get_attachment) are combined into allTools and provided to the MCP server's listTools handler.
    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. It states 'Get details' but does not specify what details are returned (e.g., metadata, content, permissions), whether it's a read-only operation, error conditions, or authentication needs. This is a significant gap for a tool with no annotation coverage.

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 a single, efficient sentence ('Get details of a specific attachment') that is front-loaded and wastes no words. It directly conveys the core purpose without unnecessary elaboration, making it highly concise and well-structured.

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 complexity (a retrieval tool with no annotations and no output schema), the description is incomplete. It lacks details on return values (e.g., what 'details' include), error handling, or behavioral traits like rate limits. For a tool with rich sibling context and no structured output, more information is needed to ensure proper agent usage.

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

Parameters3/5

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

The input schema has 100% description coverage, with the 'id' parameter documented as 'Attachment ID'. The description does not add any meaning beyond this, such as format examples or constraints. With high schema coverage, the baseline score of 3 is appropriate as the schema handles parameter documentation adequately.

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

Purpose4/5

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

The description 'Get details of a specific attachment' clearly states the verb ('Get') and resource ('attachment'), making the purpose understandable. However, it does not explicitly differentiate from sibling tools like 'list_attachments' (which likely lists multiple attachments) or 'get_book' (which retrieves a different resource), missing full sibling distinction.

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 does not mention prerequisites (e.g., needing an attachment ID), exclusions, or comparisons to siblings like 'list_attachments' for bulk retrieval or 'get_image' for specific attachment types, leaving usage context unclear.

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