Skip to main content
Glama

update_chapter

Modify an existing chapter in BookStack by updating its name, description, tags, priority, or default template using the chapter ID.

Instructions

Update an existing chapter

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
default_template_idNoDefault template ID for new pages
descriptionNoChapter description (plain text)
description_htmlNoChapter description (HTML format)
idYesChapter ID
nameNoChapter name (max 255 chars)
priorityNoChapter priority/order
tagsNoArray of tags with name and value

Implementation Reference

  • Handler logic for the 'update_chapter' tool: extracts chapter ID, validates update data using UpdateChapterSchema, converts tags, calls BookStackClient.updateChapter, and formats the response.
    case "update_chapter": { const { id, ...updateData } = args; const chapterId = parseInteger(id); const validatedData = UpdateChapterSchema.parse(updateData); const data = { ...validatedData, tags: convertTags(validatedData.tags), }; const result = await client.updateChapter(chapterId, data); return formatApiResponse(result); }
  • Tool registration in createContentTools: defines the 'update_chapter' tool with name, description, and inputSchema matching the validation schema.
    { name: "update_chapter", description: "Update an existing chapter", inputSchema: { type: "object", properties: { id: { type: "number", description: "Chapter ID" }, name: { type: "string", description: "Chapter name (max 255 chars)" }, description: { type: "string", description: "Chapter description (plain text)", }, description_html: { type: "string", description: "Chapter description (HTML 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: "Chapter priority/order" }, default_template_id: { type: "number", description: "Default template ID for new pages", }, }, required: ["id"], },
  • Zod schema for validating input data for updating a chapter, derived from CreateChapterSchema by making fields optional and omitting book_id.
    export const UpdateChapterSchema = CreateChapterSchema.partial().omit({ book_id: true, });
  • BookStackClient method that performs the actual API PUT request to update a chapter.
    async updateChapter( id: number, data: Partial<CreateChapterRequest> ): Promise<Chapter> { return this.put<Chapter>(`/chapters/${id}`, data); }
  • src/index.ts:86-86 (registration)
    Inclusion of 'update_chapter' in the contentToolNames array for routing tool calls to handleContentTool.
    "update_chapter",

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