Skip to main content
Glama
mwhesse

Dataverse MCP Server

by mwhesse

Remove Role from User

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);
Behavior3/5

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

With no annotations provided, the description carries full burden. It correctly indicates this is a destructive operation ('removes', 'revoking') and provides usage context, but doesn't disclose important behavioral aspects like required permissions, whether the change is reversible, error conditions, or confirmation requirements for security-sensitive operations.

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?

Two sentences with zero waste - first states the action and effect, second provides usage guidance. Every word earns its place, and the most important information (what the tool does) comes first.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a security-sensitive mutation tool with no annotations and no output schema, the description provides adequate basic information about purpose and usage, but lacks important contextual details about permissions, reversibility, and expected outcomes that would be needed for safe operation.

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?

Schema description coverage is 100%, so the schema already documents both parameters adequately. The description doesn't add any parameter-specific information beyond what's in the schema (both parameters are IDs), so it meets the baseline of 3 for high schema coverage without adding extra value.

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 specific action ('Removes a security role assignment'), the resource ('from a specific user'), and the effect ('revoking the permissions granted by that role'). It distinguishes from siblings like 'remove_role_from_team' by specifying user-level operation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context for when to use ('when users change roles or no longer need certain access levels'), which helps the agent understand appropriate scenarios. However, it doesn't explicitly mention when NOT to use or name specific alternatives like 'remove_role_from_team' for team-level operations.

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

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