Skip to main content
Glama
mwhesse

Dataverse MCP Server

by mwhesse

remove_role_from_user

Remove security role assignments from users to revoke specific permissions when access requirements change or roles are updated.

Instructions

Removes a security role assignment from a specific user, revoking the permissions granted by that role. Use this when users change roles or no longer need certain access levels.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
roleIdYesID of the role to remove
userIdYesID of the user to remove the role from

Implementation Reference

  • The core handler function that executes the tool logic: deletes the security role assignment from the user using the Dataverse API.
    async (params) => { try { await client.delete(`systemusers(${params.userId})/systemuserroles_association(${params.roleId})/$ref`); return { content: [ { type: "text", text: `Successfully removed role from user.` } ] }; } catch (error) { return { content: [ { type: "text", text: `Error removing role from user: ${error instanceof Error ? error.message : 'Unknown error'}` } ], isError: true }; } } );
  • Zod input schema defining the required parameters: roleId (string) and userId (string).
    inputSchema: { roleId: z.string().describe("ID of the role to remove"), userId: z.string().describe("ID of the user to remove the role from") }
  • The registration function that registers the tool with the MCP server, including name, metadata, schema, and handler.
    export function removeRoleFromUserTool(server: McpServer, client: DataverseClient) { server.registerTool( "remove_role_from_user", { title: "Remove Role from User", description: "Removes a security role assignment from a specific user, revoking the permissions granted by that role. Use this when users change roles or no longer need certain access levels.", inputSchema: { roleId: z.string().describe("ID of the role to remove"), userId: z.string().describe("ID of the user to remove the role from") } }, async (params) => { try { await client.delete(`systemusers(${params.userId})/systemuserroles_association(${params.roleId})/$ref`); return { content: [ { type: "text", text: `Successfully removed role from user.` } ] }; } catch (error) { return { content: [ { type: "text", text: `Error removing role from user: ${error instanceof Error ? error.message : 'Unknown error'}` } ], isError: true }; } } ); }
  • src/index.ts:194-194 (registration)
    Invocation of the tool registration function during server initialization.
    removeRoleFromUserTool(server, dataverseClient);

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/mwhesse/mcp-dataverse'

If you have feedback or need assistance with the MCP directory API, please join our Discord server