Skip to main content
Glama
ttpears

BookStack MCP Server

by ttpears

Get Attachment Details

get_attachment

Retrieve attachment details and download links from BookStack documentation by providing the attachment ID.

Instructions

Get details of a specific attachment including download links

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesAttachment ID

Implementation Reference

  • The implementation of the getAttachment method in the BookStackClient class, which performs the API request.
    async getAttachment(id: number): Promise<any> {
      const response = await this.client.get(`/attachments/${id}`);
      const attachment = response.data;
      
      return {
        ...attachment,
        page_url: `${this.baseUrl}/books/${Math.floor(attachment.uploaded_to / 1000)}/page/${attachment.uploaded_to}`,
        direct_link: `[${attachment.name}](${this.baseUrl}/attachments/${attachment.id})`,
        download_url: `${this.baseUrl}/attachments/${attachment.id}`
      };
    }
  • src/index.ts:428-442 (registration)
    Registration of the "get_attachment" tool in the MCP server instance.
    server.registerTool(
      "get_attachment",
      {
        title: "Get Attachment Details",
        description: "Get details of a specific attachment including download links",
        inputSchema: {
          id: z.coerce.number().min(1).describe("Attachment ID")
        }
      },
      async (args) => {
        const attachment = await client.getAttachment(args.id);
        return {
          content: [{ type: "text", text: JSON.stringify(attachment, null, 2) }]
        };
      }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions retrieving 'download links' but doesn't specify authentication needs, rate limits, error handling, or whether the operation is read-only (implied by 'Get' but not explicit). This leaves gaps for a tool that likely involves data access.

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 that front-loads the core purpose ('Get details of a specific attachment') and adds a useful detail ('including download links') without any wasted words. It is appropriately sized for a simple tool.

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 lack of annotations and output schema, the description is incomplete. It doesn't explain what 'details' include beyond download links, potential return formats, or error cases. For a tool with one parameter but no structured output info, more context is needed to guide effective use.

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 schema description coverage is 100%, with the single parameter 'id' documented as 'Attachment ID' with a numeric type and minimum value. The description adds no additional meaning beyond this, such as format examples or context about valid IDs, so it meets the baseline for high schema coverage.

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 clearly states the verb ('Get') and resource ('details of a specific attachment'), specifying it includes download links. It distinguishes from 'get_attachments' (plural) by focusing on a single attachment, but doesn't explicitly contrast with other sibling tools like export functions.

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?

No guidance is provided on when to use this tool versus alternatives like 'get_attachments' for multiple attachments or export tools for downloading content. The description implies usage for retrieving details of a specific attachment but offers no context about prerequisites or exclusions.

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/ttpears/bookstack-mcp'

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