get_attachment
Retrieve details of a specific attachment from BookStack wiki using its unique attachment ID to access file information and metadata.
Instructions
Get details of a specific attachment
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Attachment ID |
Implementation Reference
- src/tools/search-user-tools.ts:479-483 (handler)Handler logic for the 'get_attachment' tool: parses the attachment ID from arguments, calls the BookStack client's getAttachment method, and formats the response.case "get_attachment": { const id = parseInteger(args.id); const result = await client.getAttachment(id); return formatApiResponse(result); }
- Tool schema definition for 'get_attachment', specifying input as an object with required 'id' property of type number.{ name: "get_attachment", description: "Get details of a specific attachment", inputSchema: { type: "object", properties: { id: { type: "number", description: "Attachment ID" }, }, required: ["id"], }, },
- src/index.ts:57-59 (registration)Registration of tools by including the output of createSearchAndUserTools (which defines 'get_attachment') in the allTools array used for MCP server tool listing....createContentTools(bookStackClient), ...createSearchAndUserTools(bookStackClient), ];
- src/lib/bookstack-client.ts:342-347 (helper)BookStackClient helper method that performs the actual API call to retrieve attachment details by ID.async getAttachment(id: number): Promise<Attachment> { const response: AxiosResponse<Attachment> = await this.api.get( `/attachments/${id}` ); return response.data; }
- src/index.ts:116-122 (registration)Explicit listing of 'get_attachment' in the searchUserToolNames array for tool dispatch routing to the correct handler."get_attachment", "delete_attachment", "list_images", "get_image", "update_image", "delete_image", ];