Skip to main content
Glama

delete_role

Remove a role from BookStack to manage user permissions. Users assigned to this role will lose their associated access rights.

Instructions

Delete a role (users with this role will lose it)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesRole ID
migrate_ownership_idNoID of role to transfer ownership of content to

Implementation Reference

  • Main execution logic for the delete_role tool in handleSearchAndUserTool function. Parses input arguments, calls client.deleteRole, and returns success message.
    case "delete_role": {
      const { id, migrate_ownership_id } = args;
      const roleId = parseInteger(id);
      const migrateId = migrate_ownership_id
        ? parseInteger(migrate_ownership_id)
        : undefined;
    
      await client.deleteRole(roleId);
      return `Role ${roleId} deleted successfully`;
    }
  • Tool definition including name, description, and input schema for 'delete_role' returned by createSearchAndUserTools.
    {
      name: "delete_role",
      description: "Delete a role (users with this role will lose it)",
      inputSchema: {
        type: "object",
        properties: {
          id: { type: "number", description: "Role ID" },
          migrate_ownership_id: {
            type: "number",
            description: "ID of role to transfer ownership of content to",
          },
        },
        required: ["id"],
      },
    },
  • BookStackClient.deleteRole method that sends the DELETE request to the BookStack API endpoint /roles/{id}.
    async deleteRole(id: number): Promise<void> {
      return this.delete(`/roles/${id}`);
    }
  • src/index.ts:103-128 (registration)
    Registration in the main server handler: 'delete_role' is listed in searchUserToolNames array, directing calls to handleSearchAndUserTool. Tools are also provided via createSearchAndUserTools in allTools.
    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 {
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions the consequence ('users with this role will lose it'), which is a critical behavioral trait, but fails to address other important aspects such as permissions required, whether the action is reversible, error conditions, or what happens to content owned by the role. This leaves significant gaps for a destructive 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 that is front-loaded with the core action and includes essential consequence information. There is no wasted text, and it is appropriately sized for the tool's complexity.

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 the tool's destructive nature, lack of annotations, and no output schema, the description is incomplete. It mentions a key consequence but omits critical details like permissions, reversibility, error handling, and response format. For a mutation tool with significant impact, this is inadequate to ensure safe and correct usage.

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?

The schema description coverage is 100%, so the schema already documents both parameters (id and migrate_ownership_id) adequately. The description does not add any additional meaning or context beyond what the schema provides, such as explaining the purpose of migrate_ownership_id in more detail. This meets the baseline for high schema coverage.

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

Purpose5/5

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

The description clearly states the action ('Delete a role') and specifies the resource ('role'), with an explicit consequence ('users with this role will lose it') that distinguishes it from other delete operations like delete_user or delete_book. It uses a specific verb and resource, making the purpose unambiguous.

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, such as update_role or other deletion tools like delete_user. It lacks context on prerequisites, permissions, or scenarios where deletion is appropriate, leaving the agent to 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