Skip to main content
Glama

update_page

Modify existing BookStack wiki pages by updating content, metadata, or structure. Change page name, HTML/markdown content, tags, priority, or move pages between books/chapters using the page ID.

Instructions

Update an existing page

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
book_idNoMove to different book ID
chapter_idNoMove to different chapter ID
htmlNoPage content in HTML format
idYesPage ID
markdownNoPage content in Markdown format
nameNoPage name (max 255 chars)
priorityNoPage priority/order
tagsNoArray of tags with name and value

Implementation Reference

  • Handler logic for the 'update_page' tool within the handleContentTool switch statement. Parses the page ID, validates input data using UpdatePageSchema, converts tags, calls the BookStack client's updatePage method, and formats the 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);
  • Zod schema used for input validation in the update_page handler. Defines optional properties for updating page details like book_id, chapter_id, name, content (html/markdown), tags, and priority.
    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(), });
  • Tool registration object in createContentTools function array. Specifies name, description, and detailed inputSchema for the MCP tool protocol.
    { 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"], },
  • BookStackClient helper method that executes the actual API PUT request to update a page via `/pages/{id}` endpoint.
    async updatePage( id: number, data: Partial<CreatePageRequest> ): Promise<Page> { return this.put<Page>(`/pages/${id}`, data);
  • src/index.ts:91-100 (registration)
    Dispatch registration in index.ts where 'update_page' is listed in contentToolNames array to route calls to handleContentTool.
    "create_page", "update_page", "delete_page", "export_page", "list_shelves", "get_shelf", "create_shelf", "update_shelf", "delete_shelf", ];

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/lautarobarba/bookstack_mcp_server'

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