Skip to main content
Glama
rafteles2016

MCP Dynamics CRM Server

by rafteles2016

dynamics_get_active_processes

Lists active workflows, actions, and business processes in Dynamics CRM with their current statuses to monitor system operations.

Instructions

Lista processos ativos (workflows, actions, BPFs) e seus estados

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
processTypeNoall
stateFilterNoactive

Implementation Reference

  • The handler implementation for 'dynamics_get_active_processes', which constructs filter queries, retrieves workflow data from the client, and formats the output.
    server.tool(
      "dynamics_get_active_processes",
      "Lista processos ativos (workflows, actions, BPFs) e seus estados",
      GetActiveProcessesSchema.shape,
      async (params: z.infer<typeof GetActiveProcessesSchema>) => {
        const filters: string[] = [];
        const typeMap: Record<string, number> = {
          workflow: 0,
          action: 1,
          businessprocessflow: 2,
          dialog: 3,
        };
    
        if (params.processType !== "all") {
          filters.push(`category eq ${typeMap[params.processType]}`);
        }
        if (params.stateFilter === "active") {
          filters.push("statecode eq 1");
        } else if (params.stateFilter === "inactive") {
          filters.push("statecode eq 0");
        }
    
        const result = await client.list("workflows", {
          select: [
            "workflowid", "name", "category", "type", "statecode", "statuscode",
            "primaryentity", "mode", "scope", "ondemand", "triggeroncreate",
            "triggeronupdateattributelist", "triggerondelete", "createdon", "modifiedon",
          ],
          filter: filters.length > 0 ? filters.join(" and ") : undefined,
          orderby: "name asc",
        });
    
        const processes = result.value as Array<Record<string, unknown>>;
        const categorySummary: Record<string, number> = {};
        const categoryNames: Record<number, string> = { 0: "Workflow", 1: "Action", 2: "Business Process Flow", 3: "Dialog" };
    
        for (const proc of processes) {
          const catName = categoryNames[proc.category as number] || "Outro";
          categorySummary[catName] = (categorySummary[catName] || 0) + 1;
        }
    
        return {
          content: [
            {
              type: "text" as const,
              text: `## Processos Ativos\n\n**Resumo por Categoria:**\n${Object.entries(categorySummary).map(([cat, count]) => `- ${cat}: ${count}`).join("\n")}\n\n**Total:** ${processes.length}\n\n**Detalhes:**\n${JSON.stringify(processes.slice(0, 20), null, 2)}`,
            },
          ],
        };
      }
    );
  • The Zod schema definition for 'dynamics_get_active_processes' inputs.
    export const GetActiveProcessesSchema = z.object({
      processType: z.enum(["all", "workflow", "action", "businessprocessflow", "dialog"]).default("all"),
      stateFilter: z.enum(["all", "active", "inactive"]).default("active"),
    });
  • The registration of the 'dynamics_get_active_processes' tool via server.tool.
    "dynamics_get_active_processes",
Behavior2/5

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

With no annotations provided, the description carries full burden but offers minimal behavioral insight. It implies a read-only operation by using 'Lista' (List), but doesn't disclose permissions needed, rate limits, pagination, return format, or what 'ativos' (active) means operationally. This is inadequate for a tool with potential complexity in process management.

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, efficient sentence in Portuguese that front-loads the core purpose. There's no wasted text, and it directly communicates the tool's function without redundancy.

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 no annotations, no output schema, and 0% schema description coverage, the description is insufficient. It lacks details on behavior, output, error handling, or how to interpret results (e.g., what data is returned for each process). For a tool that might return complex process states, this leaves significant gaps for an AI agent.

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 0%, but both parameters have enums that self-document (e.g., processType with 'workflow', 'action', etc.). The description doesn't add meaning beyond the schema—it doesn't explain what 'processos ativos' entails or how filters interact. Baseline 3 is appropriate as the enums provide some clarity, but the description doesn't compensate for the lack of schema descriptions.

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 verb 'Lista' (List) and the resource 'processos ativos' (active processes), specifying the types of processes included (workflows, actions, BPFs). It distinguishes from many siblings that focus on solutions, columns, plugins, etc., but doesn't explicitly differentiate from other 'get' tools like dynamics_get_audit_history or dynamics_get_views.

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?

No guidance is provided on when to use this tool versus alternatives. The description doesn't mention prerequisites, context, or compare it to similar tools like dynamics_get_system_jobs or dynamics_get_workflow_performance, leaving the agent to infer usage from the name alone.

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