Skip to main content
Glama

update_shelf

Modify an existing shelf in BookStack by updating its name, description, books, or tags using the shelf ID.

Instructions

Update an existing shelf

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesShelf ID
nameNoShelf name (max 255 chars)
descriptionNoShelf description (plain text)
description_htmlNoShelf description (HTML format)
booksNoArray of book IDs (replaces existing books)
tagsNoArray of tags with name and value

Implementation Reference

  • MCP tool handler for 'update_shelf': extracts shelf ID, validates input with UpdateShelfSchema, converts tags, calls BookStack client.updateShelf, and returns formatted response.
    case "update_shelf": {
      const { id, ...updateData } = args;
      const shelfId = parseInteger(id);
      const validatedData = UpdateShelfSchema.parse(updateData);
      const data = {
        ...validatedData,
        tags: convertTags(validatedData.tags),
      };
      const result = await client.updateShelf(shelfId, data);
      return formatApiResponse(result);
    }
  • Tool registration: defines the 'update_shelf' Tool object with name, description, and inputSchema matching the validation.
    {
      name: "update_shelf",
      description: "Update an existing shelf",
      inputSchema: {
        type: "object",
        properties: {
          id: { type: "number", description: "Shelf ID" },
          name: { type: "string", description: "Shelf name (max 255 chars)" },
          description: {
            type: "string",
            description: "Shelf description (plain text)",
          },
          description_html: {
            type: "string",
            description: "Shelf description (HTML format)",
          },
          books: {
            type: "array",
            description: "Array of book IDs (replaces existing books)",
            items: { type: "number" },
          },
          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"],
            },
          },
        },
        required: ["id"],
      },
  • Zod schemas: CreateShelfSchema for full creation, UpdateShelfSchema as partial for updates, used to validate tool inputs.
    export const CreateShelfSchema = z.object({
      name: z.string().min(1).max(255),
      description: z.string().optional(),
      description_html: z.string().optional(),
      books: z.array(z.number()).optional(),
      tags: z.array(TagSchema).optional(),
    });
    
    export const UpdateShelfSchema = CreateShelfSchema.partial();
  • BookStackClient helper method: performs PUT request to /shelves/{id} to update the shelf via the API.
    async updateShelf(
      id: number,
      data: Partial<CreateShelfRequest>
    ): Promise<Shelf> {
      return this.put<Shelf>(`/shelves/${id}`, data);
    }
  • src/index.ts:98-100 (registration)
    Dispatch registration: 'update_shelf' listed in contentToolNames array to route calls to handleContentTool.
      "update_shelf",
      "delete_shelf",
    ];
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. 'Update an existing shelf' implies a mutation operation but doesn't specify permissions needed, whether changes are reversible, rate limits, or what happens to unspecified fields (partial vs. full updates). The description lacks critical behavioral context for a write operation.

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

Conciseness5/5

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

The description is a single, efficient sentence with zero wasted words. It's appropriately sized for a basic update operation and front-loads the essential information (verb + resource).

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?

For a mutation tool with 6 parameters, no annotations, and no output schema, the description is incomplete. It doesn't address behavioral aspects (permissions, side effects), usage context, or return values. The schema covers parameters well, but the description fails to compensate for missing annotation and output information.

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 all parameters are documented in the schema itself. The description adds no additional meaning about parameters beyond what's in the schema (e.g., it doesn't clarify that 'books' replaces existing books or that 'id' is required). Baseline 3 is appropriate when 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 shelf' clearly states the action (update) and resource (shelf), but it's vague about what specifically gets updated. It doesn't distinguish this tool from other update_* siblings like update_book or update_user, which all follow the same pattern.

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?

No guidance is provided on when to use this tool versus alternatives. The description doesn't mention prerequisites (e.g., needing an existing shelf ID), when not to use it, or how it differs from create_shelf or other update operations in the sibling list.

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