Skip to main content
Glama
mwhesse

Dataverse MCP Server

by mwhesse

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);

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