Skip to main content
Glama
michsob

PowerPlatform MCP

Check Component Dependencies

check-component-dependencies

Identify dependent components before deleting PowerPlatform elements to prevent breaking changes. Returns all dependent items to ensure safe removal from Dataverse environments.

Instructions

Check dependencies for a PowerPlatform component before deletion. Returns all components that depend on the specified component.

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
dependenciesYes

Implementation Reference

  • The async handler function that executes the check-component-dependencies tool logic. It retrieves the dependency service from the registry and calls checkDependencies() with the provided componentId and componentType, then returns formatted results.
    async ({ componentId, componentType, environment }) => {
      try {
        const ctx = registry.getContext(environment);
        const service = ctx.getDependencyService();
        const dependencies = await service.checkDependencies(componentId, componentType);
    
        return {
          structuredContent: { componentId, componentType, dependencies },
          content: [
            {
              type: "text",
              text: `Dependencies for component '${componentId}' (type ${componentType}):\n\n${JSON.stringify(dependencies, null, 2)}`,
            },
          ],
        };
      } catch (error: any) {
        console.error("Error checking component dependencies:", error);
        return {
          content: [
            {
              type: "text",
              text: `Failed to check component dependencies: ${error.message}`,
            },
          ],
        };
      }
    }
  • Input/output schema definition for the check-component-dependencies tool. Defines componentId (string), componentType (number), and optional environment parameters using Zod validation.
    {
      title: "Check Component Dependencies",
      description: "Check dependencies for a PowerPlatform component before deletion. Returns all components that depend on the specified component.",
      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(),
        dependencies: z.any(),
      }),
    },
  • Registration of the check-component-dependencies tool with the MCP server. Includes the tool name, schema configuration, and handler function binding.
    server.registerTool(
      "check-component-dependencies",
      {
        title: "Check Component Dependencies",
        description: "Check dependencies for a PowerPlatform component before deletion. Returns all components that depend on the specified component.",
        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(),
          dependencies: z.any(),
        }),
      },
      async ({ componentId, componentType, environment }) => {
        try {
          const ctx = registry.getContext(environment);
          const service = ctx.getDependencyService();
          const dependencies = await service.checkDependencies(componentId, componentType);
    
          return {
            structuredContent: { componentId, componentType, dependencies },
            content: [
              {
                type: "text",
                text: `Dependencies for component '${componentId}' (type ${componentType}):\n\n${JSON.stringify(dependencies, null, 2)}`,
              },
            ],
          };
        } catch (error: any) {
          console.error("Error checking component dependencies:", error);
          return {
            content: [
              {
                type: "text",
                text: `Failed to check component dependencies: ${error.message}`,
              },
            ],
          };
        }
      }
    );
  • Core implementation of the checkDependencies method in DependencyService. Makes the actual API call to PowerPlatform's RetrieveDependenciesForDelete endpoint using the PowerPlatformClient.
    async checkDependencies(
      componentId: string,
      componentType: number
    ): Promise<unknown> {
      return this.client.post(
        'api/data/v9.2/RetrieveDependenciesForDelete',
        {
          ObjectId: componentId,
          ComponentType: componentType,
        }
      );
    }
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It implies a read-only operation through 'Returns all components,' but does not explicitly guarantee safety (no deletion occurs), mention required permissions, or note side effects. It meets minimum viable disclosure but lacks rich behavioral context.

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 consists of two efficient sentences with zero waste. It is front-loaded with the action and context ('Check dependencies... before deletion') followed by the return value description. Every word earns its place.

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?

Given the 100% schema coverage, existence of an output schema, and the tool's focused scope (3 parameters), the description is reasonably complete. It covers the primary use case and return value. It could be improved by explicitly stating the read-only nature given the lack of annotations, but it adequately supports tool selection.

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 input schema has 100% description coverage, establishing a baseline of 3. The description adds minimal semantic value beyond the schema, though the 'before deletion' context colors how an agent should interpret the componentId/componentType parameters. It does not add syntax details or validation rules absent from the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool checks dependencies for a PowerPlatform component and specifies the unique context 'before deletion.' It identifies the resource (dependencies) and action (check/return), though it could more explicitly distinguish from the sibling tool 'check-delete-eligibility.'

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?

The phrase 'before deletion' provides implied usage context, suggesting when to invoke this tool (pre-deletion safety check). However, it lacks explicit guidance on when NOT to use it or how it differs from 'check-delete-eligibility' or other metadata tools.

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