Skip to main content
Glama
mwhesse

Dataverse MCP Server

by mwhesse

Remove Privilege from Dataverse Role

remove_privilege_from_role

Remove specific permissions from a security role to restrict user access and maintain proper authorization controls in Microsoft Dataverse.

Instructions

Removes a specific privilege from a security role, revoking the associated permissions. Use this to restrict access by removing specific operation permissions from a role.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
privilegeIdYesID of the privilege to remove
roleIdYesID of the role to remove privilege from

Implementation Reference

  • The asynchronous handler function that implements the core logic of the tool by invoking the Dataverse 'RemovePrivilegeRole' action with the provided roleId and privilegeId, handling success and error responses.
    async (params) => {
      try {
        await client.callAction('RemovePrivilegeRole', {
          RoleId: params.roleId,
          PrivilegeId: params.privilegeId
        });
    
        return {
          content: [
            {
              type: "text",
              text: `Successfully removed privilege from role.`
            }
          ]
        };
      } catch (error) {
        return {
          content: [
            {
              type: "text",
              text: `Error removing privilege from role: ${error instanceof Error ? error.message : 'Unknown error'}`
            }
          ],
          isError: true
        };
      }
    }
  • Zod-based input schema defining the required parameters: roleId (string) and privilegeId (string).
    inputSchema: {
      roleId: z.string().describe("ID of the role to remove privilege from"),
      privilegeId: z.string().describe("ID of the privilege to remove")
    }
  • Registers the 'remove_privilege_from_role' tool on the MCP server, including title, description, input schema, and handler.
    server.registerTool(
      "remove_privilege_from_role",
      {
        title: "Remove Privilege from Dataverse Role",
        description: "Removes a specific privilege from a security role, revoking the associated permissions. Use this to restrict access by removing specific operation permissions from a role.",
        inputSchema: {
          roleId: z.string().describe("ID of the role to remove privilege from"),
          privilegeId: z.string().describe("ID of the privilege to remove")
        }
      },
      async (params) => {
        try {
          await client.callAction('RemovePrivilegeRole', {
            RoleId: params.roleId,
            PrivilegeId: params.privilegeId
          });
    
          return {
            content: [
              {
                type: "text",
                text: `Successfully removed privilege from role.`
              }
            ]
          };
        } catch (error) {
          return {
            content: [
              {
                type: "text",
                text: `Error removing privilege from role: ${error instanceof Error ? error.message : 'Unknown error'}`
              }
            ],
            isError: true
          };
        }
      }
    );
  • src/index.ts:188-188 (registration)
    Invokes the removePrivilegeFromRoleTool function to perform the actual tool registration on the main MCP server instance.
    removePrivilegeFromRoleTool(server, dataverseClient);
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states the tool performs a removal/revocation action, implying mutation, but lacks details on permissions required, whether changes are reversible, side effects, or error conditions. For a security mutation tool, this is a significant gap in behavioral disclosure.

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, zero waste. First sentence states purpose and outcome, second provides usage context. Appropriately sized and front-loaded with essential information.

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?

Given no annotations and no output schema, the description is minimal but functional. It covers the basic purpose and usage, but for a security mutation tool, it should ideally include more about behavioral implications, permissions, or response format to be fully complete.

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%, with clear parameter descriptions in the schema. The description adds no additional parameter semantics beyond what the schema provides, such as format examples or relationship between privilegeId and roleId. Baseline 3 is appropriate when schema does the heavy lifting.

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 specific privilege'), target resource ('from a security role'), and outcome ('revoking the associated permissions'). It distinguishes from siblings like 'add_privileges_to_role' and 'replace_role_privileges' by specifying removal rather than addition or replacement.

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 ('Use this to restrict access by removing specific operation permissions from a role'), but does not explicitly mention when not to use or name alternatives like 'replace_role_privileges' for bulk updates. It implies usage for fine-grained permission revocation.

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