Skip to main content
Glama
mwhesse

Dataverse MCP Server

by mwhesse

Delete Dataverse Security Role

delete_dataverse_role

Remove security roles from Microsoft Dataverse to maintain clean access control. This permanent deletion requires verifying the role is not currently assigned to users or teams.

Instructions

Permanently deletes a security role from Dataverse. WARNING: This action cannot be undone and will fail if the role is assigned to any users or teams. Ensure the role is not in use before deletion.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
roleIdYesID of the role to delete

Implementation Reference

  • The core handler function that executes the tool by deleting the Dataverse security role with the given roleId using the DataverseClient.
      async (params) => {
        try {
          await client.delete(`roles(${params.roleId})`);
    
          return {
            content: [
              {
                type: "text",
                text: `Successfully deleted security role.`
              }
            ]
          };
        } catch (error) {
          return {
            content: [
              {
                type: "text",
                text: `Error deleting security role: ${error instanceof Error ? error.message : 'Unknown error'}`
              }
            ],
            isError: true
          };
        }
      }
    );
  • The input schema and metadata for the tool, defining the required 'roleId' parameter of type string.
    {
      title: "Delete Dataverse Security Role",
      description: "Permanently deletes a security role from Dataverse. WARNING: This action cannot be undone and will fail if the role is assigned to any users or teams. Ensure the role is not in use before deletion.",
      inputSchema: {
        roleId: z.string().describe("ID of the role to delete")
      }
    },
  • The server.registerTool call within deleteRoleTool function that registers the tool with name 'delete_dataverse_role'.
      server.registerTool(
        "delete_dataverse_role",
        {
          title: "Delete Dataverse Security Role",
          description: "Permanently deletes a security role from Dataverse. WARNING: This action cannot be undone and will fail if the role is assigned to any users or teams. Ensure the role is not in use before deletion.",
          inputSchema: {
            roleId: z.string().describe("ID of the role to delete")
          }
        },
        async (params) => {
          try {
            await client.delete(`roles(${params.roleId})`);
    
            return {
              content: [
                {
                  type: "text",
                  text: `Successfully deleted security role.`
                }
              ]
            };
          } catch (error) {
            return {
              content: [
                {
                  type: "text",
                  text: `Error deleting security role: ${error instanceof Error ? error.message : 'Unknown error'}`
                }
              ],
              isError: true
            };
          }
        }
      );
    }
  • src/index.ts:183-183 (registration)
    The invocation of deleteRoleTool which triggers the tool registration on the MCP server.
    deleteRoleTool(server, dataverseClient);
Behavior5/5

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

Since no annotations are provided, the description carries the full burden of behavioral disclosure. It effectively describes key traits: the action is permanent ('cannot be undone'), has a prerequisite (role must not be assigned), and includes a failure condition. This covers critical aspects like destructiveness and constraints that annotations would otherwise indicate.

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 front-loaded with the core action and warning, followed by a prerequisite. Every sentence adds value—none are redundant or verbose—making it efficiently structured and appropriately sized for the tool's complexity.

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

Completeness4/5

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

For a destructive tool with no annotations and no output schema, the description is largely complete, covering purpose, behavior, and usage constraints. However, it lacks details on error responses or post-deletion effects, which could enhance completeness given the high-stakes nature of deletion operations.

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?

The schema description coverage is 100%, with the parameter 'roleId' fully documented in the schema. The description does not add any additional meaning or context about the parameter beyond what the schema provides, such as format examples or sourcing details, so it meets the baseline for high schema coverage.

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 ('permanently deletes') and resource ('a security role from Dataverse'), distinguishing it from sibling tools like 'delete_dataverse_businessunit' or 'delete_dataverse_team' that target different resources. It precisely communicates the tool's function without ambiguity.

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 on when to use it (e.g., 'Ensure the role is not in use before deletion') and mentions a failure condition ('will fail if the role is assigned to any users or teams'), but it does not explicitly name alternative tools or specify when not to use it relative to siblings like 'remove_role_from_user' or 'update_dataverse_role'.

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