Skip to main content
Glama

create_page

Add a new page to a BookStack wiki by specifying content in HTML or Markdown format, organizing it within books or chapters, and applying tags for categorization.

Instructions

Create a new page in a book or chapter

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
book_idNoParent book ID (required if not in chapter)
chapter_idNoParent chapter ID (required if not directly in book)
nameYesPage name (required, max 255 chars)
htmlNoPage content in HTML format
markdownNoPage content in Markdown format
tagsNoArray of tags with name and value
priorityNoPage priority/order

Implementation Reference

  • Handler logic for the 'create_page' tool: validates input using CreatePageSchema, processes tags, calls BookStackClient.createPage, and returns formatted response.
    case "create_page": { const validatedData = CreatePageSchema.parse(args); const data = { ...validatedData, tags: convertTags(validatedData.tags), }; const result = await client.createPage(data); return formatApiResponse(result); }
  • Zod validation schema (CreatePageSchema) used in the handler to parse and validate tool arguments.
    export const CreatePageSchema = z .object({ book_id: z.number().optional(), chapter_id: z.number().optional(), name: z.string().min(1).max(255), html: z.string().optional(), markdown: z.string().optional(), tags: z.array(TagSchema).optional(), priority: z.number().optional(), }) .refine((data) => data.book_id || data.chapter_id, { message: "Either book_id or chapter_id must be provided", }) .refine((data) => data.html || data.markdown, { message: "Either html or markdown content must be provided", });
  • MCP Tool registration object for 'create_page', including name, description, and JSON inputSchema, returned by createContentTools().
    name: "create_page", description: "Create a new page in a book or chapter", inputSchema: { type: "object", properties: { book_id: { type: "number", description: "Parent book ID (required if not in chapter)", }, chapter_id: { type: "number", description: "Parent chapter ID (required if not directly in book)", }, name: { type: "string", description: "Page name (required, 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: ["name"], },
  • src/index.ts:76-100 (registration)
    Registration of 'create_page' in the dispatch array contentToolNames, used to route calls to handleContentTool.
    const contentToolNames = [ "list_books", "get_book", "create_book", "update_book", "delete_book", "export_book", "list_chapters", "get_chapter", "create_chapter", "update_chapter", "delete_chapter", "export_chapter", "list_pages", "get_page", "create_page", "update_page", "delete_page", "export_page", "list_shelves", "get_shelf", "create_shelf", "update_shelf", "delete_shelf", ];
  • BookStackClient helper method that makes the actual API POST request to create a page.
    async createPage(data: CreatePageRequest): Promise<Page> { return this.post<Page>("/pages", data); }

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