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 {

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