Skip to main content
Glama
rafteles2016

MCP Dynamics CRM Server

by rafteles2016

dynamics_register_plugin_step

Register a new plugin step in Dynamics CRM to extend functionality by defining execution triggers, stages, and target entities for custom business logic.

Instructions

Registra um novo step de plugin no Dynamics CRM

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pluginTypeIdYesID do tipo de plugin
messageYesMensagem do SDK (ex: Create, Update)
entityLogicalNameYesNome lógico da entidade
stageYesEstágio: 10=PreValidation, 20=PreOperation, 40=PostOperation
executionModeNo0=Synchronous, 1=Asynchronous
filteringAttributesNoAtributos de filtragem
nameYesNome do step
rankNoOrdem de execução

Implementation Reference

  • Implementation of the dynamics_register_plugin_step tool handler.
    server.tool(
      "dynamics_register_plugin_step",
      "Registra um novo step de plugin no Dynamics CRM",
      RegisterPluginStepSchema.shape,
      async (params: z.infer<typeof RegisterPluginStepSchema>) => {
        const stepData = {
          name: params.name,
          stage: params.stage,
          mode: params.executionMode,
          rank: params.rank,
          "plugintypeid@odata.bind": `/plugintypes(${params.pluginTypeId})`,
          "sdkmessageid@odata.bind": `/sdkmessages?$filter=name eq '${params.message}'`,
          filteringattributes: params.filteringAttributes || null,
          supporteddeployment: 0, // Server only
        };
    
        // Get the message filter for the entity
        const messageFilter = await client.list("sdkmessagefilters", {
          select: ["sdkmessagefilterid"],
          filter: `primaryobjecttypecode eq '${params.entityLogicalName}' and sdkmessageid/name eq '${params.message}'`,
          top: 1,
        });
    
        if (messageFilter.value.length > 0) {
          const filterId = (messageFilter.value[0] as Record<string, unknown>).sdkmessagefilterid;
          (stepData as Record<string, unknown>)["sdkmessagefilterid@odata.bind"] = `/sdkmessagefilters(${filterId})`;
        }
    
        const result = await client.create("sdkmessageprocessingsteps", stepData);
    
        return {
          content: [
            {
              type: "text" as const,
              text: `Step registrado com sucesso!\nID: ${result.entityId}\nNome: ${params.name}\nMensagem: ${params.message}\nEntidade: ${params.entityLogicalName}\nEstágio: ${params.stage}`,
            },
          ],
        };
      }
    );
  • Input schema for dynamics_register_plugin_step tool.
    export const RegisterPluginStepSchema = z.object({
      pluginTypeId: z.string().describe("ID do tipo de plugin"),
      message: z.string().describe("Mensagem do SDK (ex: Create, Update)"),
      entityLogicalName: z.string().describe("Nome lógico da entidade"),
      stage: z.number().describe("Estágio: 10=PreValidation, 20=PreOperation, 40=PostOperation"),
      executionMode: z.number().default(0).describe("0=Synchronous, 1=Asynchronous"),
      filteringAttributes: z.string().optional().describe("Atributos de filtragem"),
      name: z.string().describe("Nome do step"),
      rank: z.number().default(1).describe("Ordem de execução"),
    });
  • Registration function that defines all plugin tools, including dynamics_register_plugin_step.
    export function registerPluginTools(
      server: { tool: Function },
      client: DataverseClient
    ) {
Behavior2/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 of behavioral disclosure. It states this is a registration action, implying a write operation, but doesn't cover critical aspects like required permissions, whether it's idempotent, potential side effects, error handling, or response format. This leaves significant gaps for a tool that likely modifies system state.

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 a single, clear sentence that directly states the tool's purpose without any unnecessary words or fluff. It's front-loaded and efficiently communicates the core action, making it easy to parse quickly.

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

Completeness2/5

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

Given the complexity of registering a plugin step in Dynamics CRM (a write operation with 8 parameters, 5 required), the description is insufficient. No annotations are provided to clarify behavior, and there's no output schema, so the agent lacks information on what the tool returns or how to handle outcomes. The description should explain more about the context and implications of use.

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%, meaning all parameters are documented in the schema itself. The description adds no additional parameter semantics beyond what's in the schema, so it meets the baseline of 3 without compensating for any gaps.

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 action ('Registra' = Registers) and the resource ('um novo step de plugin no Dynamics CRM'), making the purpose understandable. However, it doesn't explicitly differentiate this tool from sibling tools like 'dynamics_list_plugin_steps' or 'dynamics_toggle_plugin_step', which would be needed for a score of 5.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives, such as when to register a new step versus listing existing steps or toggling them. There's no mention of prerequisites, dependencies, or typical use cases, leaving the agent with minimal context for decision-making.

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/rafteles2016/mcpDynamics'

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