Skip to main content
Glama
michsob

PowerPlatform MCP

Check Delete Eligibility

check-delete-eligibility

Check PowerPlatform component deletion eligibility. Returns whether deletion is allowed and lists blocking dependencies to prevent deletion errors.

Instructions

Check if a PowerPlatform component can be safely deleted. Returns whether deletion is allowed and lists blocking dependencies.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
componentIdYesThe GUID of the component to check
componentTypeYesThe component type number (e.g., 1=Entity, 9=OptionSet, 29=Workflow, 80=PluginAssembly, 90=PluginType, 92=SdkMessageProcessingStep)
environmentNoEnvironment name (e.g. DEV, UAT). Uses default if omitted.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
componentIdYes
componentTypeYes
canDeleteYes
dependenciesYes

Implementation Reference

  • The actual handler implementation of checkDeleteEligibility that calls checkDependencies and determines if a component can be deleted based on whether it has dependencies
    async checkDeleteEligibility(
      componentId: string,
      componentType: number
    ): Promise<{ canDelete: boolean; dependencies: unknown[] }> {
      try {
        const result = (await this.checkDependencies(
          componentId,
          componentType
        )) as { EntityCollection?: { Entities?: unknown[] } };
        const dependencies = result.EntityCollection?.Entities || [];
    
        return {
          canDelete: dependencies.length === 0,
          dependencies: dependencies,
        };
      } catch {
        return {
          canDelete: false,
          dependencies: [],
        };
      }
    }
  • Registration of the 'check-delete-eligibility' tool with MCP server including input/output schemas and async handler wrapper
    // Check Delete Eligibility
    server.registerTool(
      "check-delete-eligibility",
      {
        title: "Check Delete Eligibility",
        description: "Check if a PowerPlatform component can be safely deleted. Returns whether deletion is allowed and lists blocking dependencies.",
        inputSchema: {
          componentId: z.string().describe("The GUID of the component to check"),
          componentType: z.number().describe("The component type number (e.g., 1=Entity, 9=OptionSet, 29=Workflow, 80=PluginAssembly, 90=PluginType, 92=SdkMessageProcessingStep)"),
          environment: z.string().optional().describe("Environment name (e.g. DEV, UAT). Uses default if omitted."),
        },
        outputSchema: z.object({
          componentId: z.string(),
          componentType: z.number(),
          canDelete: z.boolean(),
          dependencies: z.array(z.any()),
        }),
      },
      async ({ componentId, componentType, environment }) => {
        try {
          const ctx = registry.getContext(environment);
          const service = ctx.getDependencyService();
          const result = await service.checkDeleteEligibility(componentId, componentType);
    
          const statusText = result.canDelete
            ? "✓ Component can be safely deleted (no dependencies found)"
            : `✗ Component cannot be deleted (${result.dependencies.length} dependencies found)`;
    
          return {
            structuredContent: { componentId, componentType, ...result },
            content: [
              {
                type: "text",
                text: `Delete eligibility for component '${componentId}' (type ${componentType}):\n\n${statusText}\n\nDependencies:\n${JSON.stringify(result.dependencies, null, 2)}`,
              },
            ],
          };
        } catch (error: any) {
          console.error("Error checking delete eligibility:", error);
          return {
            content: [
              {
                type: "text",
                text: `Failed to check delete eligibility: ${error.message}`,
              },
            ],
          };
        }
      }
    );
  • Zod input and output schema definitions for the check-delete-eligibility tool
    {
      title: "Check Delete Eligibility",
      description: "Check if a PowerPlatform component can be safely deleted. Returns whether deletion is allowed and lists blocking dependencies.",
      inputSchema: {
        componentId: z.string().describe("The GUID of the component to check"),
        componentType: z.number().describe("The component type number (e.g., 1=Entity, 9=OptionSet, 29=Workflow, 80=PluginAssembly, 90=PluginType, 92=SdkMessageProcessingStep)"),
        environment: z.string().optional().describe("Environment name (e.g. DEV, UAT). Uses default if omitted."),
      },
      outputSchema: z.object({
        componentId: z.string(),
        componentType: z.number(),
        canDelete: z.boolean(),
        dependencies: z.array(z.any()),
      }),
    },
Behavior4/5

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

No annotations provided, so description carries full burden. It effectively discloses return semantics: 'whether deletion is allowed' and specifically 'lists blocking dependencies,' explaining what 'eligibility' means. Missing explicit read-only/side-effect disclosure, though 'Check' implies safety.

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 tightly constructed sentences with zero waste. First sentence establishes purpose, second discloses return value. Front-loaded with key action and appropriately brief given rich schema and output schema availability.

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?

Sufficient for a 3-parameter inspection tool with 100% schema coverage and existing output schema. Description provides high-level return value summary without duplicating output schema details. Could mention environment default behavior, but omission acceptable.

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 has 100% description coverage with detailed componentType examples. Description adds no parameter-specific guidance beyond schema, which is acceptable given comprehensive schema documentation. Baseline 3 appropriate.

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?

Description uses specific verb 'Check' with clear resource 'PowerPlatform component' and distinct context 'safely deleted.' It differentiates from sibling check-component-dependencies by focusing specifically on deletion safety and blocking dependencies rather than general dependency listing.

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

Usage Guidelines3/5

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

Provides implied usage context (use when considering deletion), but lacks explicit guidance on when to use this versus check-component-dependencies or other inspection tools. No 'when not to use' or prerequisite guidance provided.

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/michsob/powerplatform-mcp'

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