list_attachments
Retrieve a paginated list of file attachments from a BookStack wiki instance to manage and organize uploaded documents and media.
Instructions
Get a listing of attachments
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page | No | Page number for pagination | |
| count | No | Number of items per page | |
| sort | No | Sort parameter |
Implementation Reference
- src/tools/search-user-tools.ts:473-477 (handler)The handler function for the 'list_attachments' tool. Parses pagination arguments, fetches attachments using the BookStackClient, and formats the response.case "list_attachments": { const params = PaginationSchema.parse(args); const result = await client.getAttachments(params); return formatApiResponse(result.data, result.total); }
- Input schema definition for the 'list_attachments' tool, supporting optional pagination parameters.{ name: "list_attachments", description: "Get a listing of attachments", inputSchema: { type: "object", properties: { page: { type: "number", description: "Page number for pagination" }, count: { type: "number", description: "Number of items per page" }, sort: { type: "string", description: "Sort parameter" }, }, }, },
- src/index.ts:56-59 (registration)Registration of the 'list_attachments' tool by including it in the complete list of tools provided to the MCP server via createSearchAndUserTools.const allTools: Tool[] = [ ...createContentTools(bookStackClient), ...createSearchAndUserTools(bookStackClient), ];
- src/index.ts:124-128 (registration)Dispatch logic in the MCP CallToolRequest handler that routes 'list_attachments' calls to the appropriate handleSearchAndUserTool function.if (contentToolNames.includes(name)) { result = await handleContentTool(name, args, bookStackClient); } else if (searchUserToolNames.includes(name)) { result = await handleSearchAndUserTool(name, args, bookStackClient); } else {