update_page
Modify existing wiki pages by updating content, metadata, or structure within BookStack. Change page text, tags, location, or priority to maintain current documentation.
Instructions
Update an existing page
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Page ID | |
| book_id | No | Move to different book ID | |
| chapter_id | No | Move to different chapter ID | |
| name | No | Page name (max 255 chars) | |
| html | No | Page content in HTML format | |
| markdown | No | Page content in Markdown format | |
| tags | No | Array of tags with name and value | |
| priority | No | Page priority/order |
Implementation Reference
- src/tools/content-tools.ts:693-703 (handler)Handler logic in handleContentTool that destructures args, parses and validates input using UpdatePageSchema, converts tags, calls client.updatePage, and returns formatted response.case "update_page": { const { id, ...updateData } = args; const pageId = parseInteger(id); const validatedData = UpdatePageSchema.parse(updateData); const data = { ...validatedData, tags: convertTags(validatedData.tags), }; const result = await client.updatePage(pageId, data); return formatApiResponse(result); }
- src/lib/validation.ts:60-68 (schema)Zod validation schema for update_page tool parameters, used in the handler for input validation.export const UpdatePageSchema = z.object({ book_id: z.number().optional(), chapter_id: z.number().optional(), name: z.string().min(1).max(255).optional(), html: z.string().optional(), markdown: z.string().optional(), tags: z.array(TagSchema).optional(), priority: z.number().optional(), });
- src/tools/content-tools.ts:359-393 (registration)Tool definition registered in createContentTools function, including name, description, and input schema matching UpdatePageSchema.{ name: "update_page", description: "Update an existing page", inputSchema: { type: "object", properties: { id: { type: "number", description: "Page ID" }, book_id: { type: "number", description: "Move to different book ID" }, chapter_id: { type: "number", description: "Move to different chapter ID", }, name: { type: "string", description: "Page name (max 255 chars)" }, html: { type: "string", description: "Page content in HTML format" }, markdown: { type: "string", description: "Page content in Markdown format", }, tags: { type: "array", description: "Array of tags with name and value", items: { type: "object", properties: { name: { type: "string" }, value: { type: "string" }, order: { type: "number" }, }, required: ["name", "value"], }, }, priority: { type: "number", description: "Page priority/order" }, }, required: ["id"], },
- src/index.ts:124-126 (registration)Dispatch logic in MCP server request handler that routes 'update_page' (listed in contentToolNames) to handleContentTool.if (contentToolNames.includes(name)) { result = await handleContentTool(name, args, bookStackClient); } else if (searchUserToolNames.includes(name)) {
- src/lib/bookstack-client.ts:215-220 (helper)BookStackClient.updatePage method called by the handler, performs the actual PUT API request to update the page.async updatePage( id: number, data: Partial<CreatePageRequest> ): Promise<Page> { return this.put<Page>(`/pages/${id}`, data); }