Skip to main content
Glama

update_book

Modify an existing book's details including name, description, tags, and default template in BookStack wiki instances through API integration.

Instructions

Update an existing book

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
default_template_idNoDefault template ID for new pages
descriptionNoBook description (plain text)
description_htmlNoBook description (HTML format)
idYesBook ID
nameNoBook name (max 255 chars)
tagsNoArray of tags with name and value

Implementation Reference

  • The handler case in handleContentTool function that executes the update_book tool: parses arguments, validates input using UpdateBookSchema, processes tags, and delegates to BookStackClient.updateBook.
    case "update_book": { const { id, ...updateData } = args; const bookId = parseInteger(id); const validatedData = UpdateBookSchema.parse(updateData); const data = { ...validatedData, tags: convertTags(validatedData.tags), }; const result = await client.updateBook(bookId, data); return formatApiResponse(result); }
  • Zod schemas for book creation and partial update validation used by the update_book tool.
    export const CreateBookSchema = z.object({ name: z.string().min(1).max(255), description: z.string().optional(), description_html: z.string().optional(), tags: z.array(TagSchema).optional(), default_template_id: z.number().optional(), }); export const UpdateBookSchema = CreateBookSchema.partial();
  • BookStackClient.updateBook method that sends PUT request to BookStack API /books/{id} endpoint to update the book.
    async updateBook( id: number, data: Partial<CreateBookRequest> ): Promise<Book> { return this.put<Book>(`/books/${id}`, data); }
  • src/index.ts:76-100 (registration)
    Registration of update_book as a content tool in the dispatch logic for CallToolRequest in the MCP server.
    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", ];
  • Tool definition object for update_book returned by createContentTools, including name, description, and inputSchema.
    { name: "update_book", description: "Update an existing book", inputSchema: { type: "object", properties: { id: { type: "number", description: "Book ID" }, name: { type: "string", description: "Book name (max 255 chars)" }, description: { type: "string", description: "Book description (plain text)", }, description_html: { type: "string", description: "Book 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"], }, }, default_template_id: { type: "number", description: "Default template ID for new pages", }, }, required: ["id"], }, },

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