Skip to main content
Glama

update_role

Modify an existing role's details such as display name, description, external authentication ID, and permissions in BookStack.

Instructions

Update an existing role

Input Schema

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

Implementation Reference

  • The main handler logic for the 'update_role' tool. It destructures the arguments to extract the role ID and update data, parses the ID to an integer, calls the BookStack client's updateRole method, and formats the API response.
    case "update_role": { const { id, ...updateData } = args; const roleId = parseInteger(id); const result = await client.updateRole(roleId, updateData); return formatApiResponse(result); }
  • The Tool object definition for 'update_role' returned by createSearchAndUserTools function, including name, description, and inputSchema. This registers the tool with the MCP server.
    { 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"], }, },
  • Zod schema definition for updating roles, which is a partial of CreateRoleSchema. Matches the structure used in the tool's inputSchema (plus required id).
    export const UpdateRoleSchema = CreateRoleSchema.partial();
  • The BookStackClient method that performs the actual API call to update a role via PUT /roles/{id}.
    async updateRole( id: number, data: Partial<CreateRoleRequest> ): Promise<Role> { return this.put<Role>(`/roles/${id}`, data); }
  • src/index.ts:124-128 (registration)
    Dispatch logic in the main CallToolRequestSchema handler that routes 'update_role' (included in searchUserToolNames) to the appropriate handleSearchAndUserTool function.
    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