Skip to main content
Glama

delete_role

Remove a role from the BookStack wiki system, with optional content ownership transfer to another role before deletion.

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

  • Handler for the 'delete_role' tool. Parses input arguments for role ID (ignores migrate_ownership_id), calls BookStackClient.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 schema definition for 'delete_role', including input validation for role ID (required) and optional migrate_ownership_id.
    { 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"], }, },
  • Supporting method in BookStackClient that executes 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 and dispatch logic in main server handler. 'delete_role' is listed in searchUserToolNames array to route tool calls 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 {

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