Skip to main content
Glama

update_role

Modify an existing BookStack role by updating its display name, description, external authentication ID, or permission assignments to manage user access control.

Instructions

Update an existing role

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesRole ID
display_nameNoDisplay name for the role
descriptionNoRole description
external_auth_idNoExternal authentication ID
permissionsNoArray of permission names to assign to the role (replaces existing)

Implementation Reference

  • Executes the update_role tool: parses role ID from arguments, calls BookStackClient.updateRole, and returns formatted response.
    case "update_role": {
      const { id, ...updateData } = args;
      const roleId = parseInteger(id);
    
      const result = await client.updateRole(roleId, updateData);
      return formatApiResponse(result);
    }
  • Input schema defining parameters for updating a role: id (required), display_name, description, external_auth_id, permissions.
    inputSchema: {
      type: "object",
      properties: {
        id: { type: "number", description: "Role ID" },
        display_name: {
          type: "string",
          description: "Display name for the role",
        },
        description: { type: "string", description: "Role description" },
        external_auth_id: {
          type: "string",
          description: "External authentication ID",
        },
        permissions: {
          type: "array",
          description:
            "Array of permission names to assign to the role (replaces existing)",
          items: { type: "string" },
        },
      },
      required: ["id"],
    },
  • Tool registration in createSearchAndUserTools: defines name, description, and inputSchema for update_role.
    {
      name: "update_role",
      description: "Update an existing role",
      inputSchema: {
        type: "object",
        properties: {
          id: { type: "number", description: "Role ID" },
          display_name: {
            type: "string",
            description: "Display name for the role",
          },
          description: { type: "string", description: "Role description" },
          external_auth_id: {
            type: "string",
            description: "External authentication ID",
          },
          permissions: {
            type: "array",
            description:
              "Array of permission names to assign to the role (replaces existing)",
            items: { type: "string" },
          },
        },
        required: ["id"],
      },
    },
  • src/index.ts:103-128 (registration)
    Registration and dispatch logic in main server: includes 'update_role' in searchUserToolNames and routes to handleSearchAndUserTool.
    const searchUserToolNames = [
      "search_all",
      "list_users",
      "get_user",
      "create_user",
      "update_user",
      "delete_user",
      "list_roles",
      "get_role",
      "create_role",
      "update_role",
      "delete_role",
      "list_attachments",
      "get_attachment",
      "delete_attachment",
      "list_images",
      "get_image",
      "update_image",
      "delete_image",
    ];
    
    if (contentToolNames.includes(name)) {
      result = await handleContentTool(name, args, bookStackClient);
    } else if (searchUserToolNames.includes(name)) {
      result = await handleSearchAndUserTool(name, args, bookStackClient);
    } else {
  • BookStackClient helper method that sends PUT request to /roles/{id} to update the role.
    async updateRole(
      id: number,
      data: Partial<CreateRoleRequest>
    ): Promise<Role> {
      return this.put<Role>(`/roles/${id}`, data);
    }
Behavior2/5

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

With no annotations, the description carries full burden but only states 'update' without disclosing behavioral traits like whether changes are reversible, permission requirements, or side effects (e.g., permissions array replaces existing). It lacks critical details for a mutation tool, making it insufficient for safe use.

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 waste. It's front-loaded and appropriately sized for the tool's complexity, earning its place without unnecessary elaboration.

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 5 parameters, no annotations, and no output schema, the description is incomplete. It doesn't cover behavioral aspects, return values, or error conditions, leaving significant gaps that could hinder an AI agent's ability to use the tool correctly.

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 schema fully documents all 5 parameters. The description adds no meaning beyond the schema, as it doesn't explain parameter interactions or usage examples. Baseline 3 is appropriate since the schema handles parameter documentation.

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 role' clearly states the verb (update) and resource (role), but it's vague about what aspects can be updated and doesn't distinguish from sibling tools like update_user or update_book. It provides basic purpose but lacks specificity about scope.

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 like create_role or delete_role, nor does it mention prerequisites (e.g., needing an existing role ID). The description assumes context without explicit instructions, leaving gaps for an AI agent.

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