Skip to main content
Glama
mwhesse

Dataverse MCP Server

by mwhesse

Get Dataverse Security Role

get_dataverse_role

Retrieve detailed security role information including properties, business unit associations, and configuration settings to inspect role definitions and understand permission structures in Microsoft Dataverse.

Instructions

Retrieves detailed information about a specific security role including its properties, business unit association, and configuration settings. Use this to inspect role definitions and understand permission structures.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
roleIdYesID of the role to retrieve

Implementation Reference

  • The main handler function for the 'get_dataverse_role' tool. It queries the Dataverse API for the specified role ID, extracts relevant properties, formats them into a JSON object, and returns the information as text content. Handles errors by returning an error message.
    async (params) => {
      try {
        const role = await client.get(`roles(${params.roleId})?$select=roleid,name,description,appliesto,isautoassigned,isinherited,summaryofcoretablepermissions,businessunitid,createdon,modifiedon,createdby,modifiedby,ismanaged,iscustomizable,canbedeleted`);
    
        const roleInfo = {
          roleId: role.roleid,
          name: role.name,
          description: role.description,
          appliesTo: role.appliesto,
          isAutoAssigned: role.isautoassigned === 1,
          isInherited: role.isinherited,
          summaryOfCoreTablePermissions: role.summaryofcoretablepermissions,
          businessUnitId: role.businessunitid,
          createdOn: role.createdon,
          modifiedOn: role.modifiedon,
          createdBy: role.createdby,
          modifiedBy: role.modifiedby,
          isManaged: role.ismanaged,
          isCustomizable: role.iscustomizable,
          canBeDeleted: role.canbedeleted
        };
    
        return {
          content: [
            {
              type: "text",
              text: `Security role information:\n\n${JSON.stringify(roleInfo, null, 2)}`
            }
          ]
        };
      } catch (error) {
        return {
          content: [
            {
              type: "text",
              text: `Error retrieving security role: ${error instanceof Error ? error.message : 'Unknown error'}`
            }
          ],
          isError: true
        };
      }
    }
  • The input schema for the tool, defining a single required string parameter 'roleId' for the security role GUID.
    inputSchema: {
      roleId: z.string().describe("ID of the role to retrieve")
    }
  • The exported getRoleTool function that performs the server.registerTool call to register the 'get_dataverse_role' tool, including its metadata, schema, and inline handler.
    export function getRoleTool(server: McpServer, client: DataverseClient) {
      server.registerTool(
        "get_dataverse_role",
        {
          title: "Get Dataverse Security Role",
          description: "Retrieves detailed information about a specific security role including its properties, business unit association, and configuration settings. Use this to inspect role definitions and understand permission structures.",
          inputSchema: {
            roleId: z.string().describe("ID of the role to retrieve")
          }
        },
        async (params) => {
          try {
            const role = await client.get(`roles(${params.roleId})?$select=roleid,name,description,appliesto,isautoassigned,isinherited,summaryofcoretablepermissions,businessunitid,createdon,modifiedon,createdby,modifiedby,ismanaged,iscustomizable,canbedeleted`);
    
            const roleInfo = {
              roleId: role.roleid,
              name: role.name,
              description: role.description,
              appliesTo: role.appliesto,
              isAutoAssigned: role.isautoassigned === 1,
              isInherited: role.isinherited,
              summaryOfCoreTablePermissions: role.summaryofcoretablepermissions,
              businessUnitId: role.businessunitid,
              createdOn: role.createdon,
              modifiedOn: role.modifiedon,
              createdBy: role.createdby,
              modifiedBy: role.modifiedby,
              isManaged: role.ismanaged,
              isCustomizable: role.iscustomizable,
              canBeDeleted: role.canbedeleted
            };
    
            return {
              content: [
                {
                  type: "text",
                  text: `Security role information:\n\n${JSON.stringify(roleInfo, null, 2)}`
                }
              ]
            };
          } catch (error) {
            return {
              content: [
                {
                  type: "text",
                  text: `Error retrieving security role: ${error instanceof Error ? error.message : 'Unknown error'}`
                }
              ],
              isError: true
            };
          }
        }
      );
    }
  • src/index.ts:181-181 (registration)
    Invocation of getRoleTool in the main server initialization to register all role-related tools on the MCP server.
    getRoleTool(server, dataverseClient);
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It indicates this is a read operation ('retrieves'), which is helpful, but lacks details on permissions required, rate limits, error conditions, or output format. The description adds some behavioral context but is incomplete for a tool with no annotation coverage.

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?

The description is two sentences, front-loaded with the core purpose and followed by usage guidance. Every sentence adds value with no wasted words, making it efficient and well-structured.

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 provides adequate purpose and usage but lacks details on behavioral aspects (e.g., permissions, errors) and output format. It is complete enough for a basic read tool but could be more comprehensive to compensate for missing structured data.

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 the parameter 'roleId' documented as 'ID of the role to retrieve.' The description does not add any additional meaning beyond this, such as format examples or where to find the ID. Baseline 3 is appropriate when the 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 verb 'retrieves' and the resource 'detailed information about a specific security role', specifying what properties are included (properties, business unit association, configuration settings). It distinguishes from siblings like 'list_dataverse_roles' (which lists roles) and 'get_role_privileges' (which focuses on privileges).

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 this tool: 'to inspect role definitions and understand permission structures.' However, it does not explicitly state when not to use it or name alternatives (e.g., 'list_dataverse_roles' for listing roles without details), which prevents a perfect score.

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