Skip to main content
Glama

update_book

Modify existing books in BookStack by updating details like name, description, tags, or default template for new pages.

Instructions

Update an existing book

Input Schema

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

Implementation Reference

  • The handler logic for the 'update_book' tool within the handleContentTool function. It extracts the book ID, validates the update data using UpdateBookSchema, converts tags if present, calls the BookStackClient's updateBook method, and returns a formatted API response.
    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 schema for validating input parameters for updating a book. It is a partial version of CreateBookSchema, allowing optional updates to book properties.
    export const UpdateBookSchema = CreateBookSchema.partial();
  • Tool registration in createContentTools function, defining the name, description, and input schema for the 'update_book' tool, which is returned in the list of tools for MCP server.
    {
      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"],
      },
    },
  • src/index.ts:80-100 (registration)
    Lists 'update_book' in the contentToolNames array used to dispatch calls to handleContentTool in the MCP server's call tool handler.
      "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 method that performs the actual API PUT request to update a book via the BookStack API.
    async updateBook(
      id: number,
      data: Partial<CreateBookRequest>
    ): Promise<Book> {
      return this.put<Book>(`/books/${id}`, data);
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. 'Update an existing book' implies a mutation operation, but it doesn't specify permissions required, whether changes are reversible, rate limits, or what happens to fields not included in the update. For a mutation tool with zero annotation coverage, this is a significant gap in transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise at just three words, which is efficient and front-loaded. However, it's arguably too brief given the tool's complexity (6 parameters, mutation operation), leaving important context unaddressed. It earns a 4 for zero waste but loses a point for under-specification.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given this is a mutation tool with 6 parameters, no annotations, and no output schema, the description is incomplete. It doesn't cover behavioral aspects (permissions, side effects), usage context, or return values. The agent lacks sufficient information to use this tool safely and effectively beyond basic parameter mapping.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the input schema already documents all parameters thoroughly. The description adds no additional meaning about parameters beyond what's in the schema (e.g., it doesn't explain relationships between fields like description vs. description_html). Baseline score of 3 is appropriate when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Update an existing book' clearly states the action (update) and resource (book), but it's vague about what specifically gets updated. It doesn't distinguish this tool from other update_* siblings like update_chapter or update_page, which all follow the same pattern of updating a resource.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing an existing book ID), when not to use it, or how it differs from sibling tools like create_book or get_book. The agent must infer usage from the tool name alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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