get_page
Retrieve content and details for a specific page using its ID to access information from a BookStack wiki instance.
Instructions
Get details and content of a specific page
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Page ID |
Implementation Reference
- src/tools/content-tools.ts:677-681 (handler)The handler function for the 'get_page' tool. It parses the page ID from arguments, calls the BookStack client's getPage method, and formats the API response.case "get_page": { const id = parseInteger(args.id); const result = await client.getPage(id); return formatApiResponse(result); }
- src/tools/content-tools.ts:307-317 (schema)The tool definition including name, description, and input schema for validating the 'id' parameter as a required number.{ name: "get_page", description: "Get details and content of a specific page", inputSchema: { type: "object", properties: { id: { type: "number", description: "Page ID" }, }, required: ["id"], }, },
- src/index.ts:56-59 (registration)Registration of tools by combining content tools (which includes 'get_page') into the allTools array provided to the MCP server.const allTools: Tool[] = [ ...createContentTools(bookStackClient), ...createSearchAndUserTools(bookStackClient), ];
- src/index.ts:124-126 (registration)Dispatch registration: routes calls to 'get_page' (listed in contentToolNames) to the handleContentTool function.if (contentToolNames.includes(name)) { result = await handleContentTool(name, args, bookStackClient); } else if (searchUserToolNames.includes(name)) {
- src/lib/bookstack-client.ts:206-209 (helper)Helper method in BookStackClient that performs the actual API GET request to retrieve a page by ID.async getPage(id: number): Promise<Page> { const response: AxiosResponse<Page> = await this.api.get(`/pages/${id}`); return response.data; }