Skip to main content
Glama
rafteles2016

MCP Dynamics CRM Server

by rafteles2016

dynamics_get_workflow_performance

Analyze workflow and automated process performance and status in Dynamics CRM to monitor execution, identify issues, and optimize business automation.

Instructions

Analisa performance e status de workflows e processos automáticos

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
topNo
statusFilterNoall

Implementation Reference

  • The handler for "dynamics_get_workflow_performance" queries 'asyncoperations' in Dynamics to provide performance and status summary of workflows.
    server.tool(
      "dynamics_get_workflow_performance",
      "Analisa performance e status de workflows e processos automáticos",
      GetWorkflowPerformanceSchema.shape,
      async (params: z.infer<typeof GetWorkflowPerformanceSchema>) => {
        const filters: string[] = [];
        if (params.statusFilter !== "all") {
          const statusCode = WORKFLOW_STATUS[params.statusFilter];
          if (statusCode !== undefined) {
            filters.push(`statuscode eq ${statusCode}`);
          }
        }
    
        const result = await client.list("asyncoperations", {
          select: [
            "asyncoperationid", "name", "operationtype", "statuscode",
            "startedon", "completedon", "executiontimespan", "retrycount",
            "friendlymessage", "message", "primaryentitytype",
            "postponeuntil", "recurrencepattern",
          ],
          filter: filters.length > 0 ? filters.join(" and ") : undefined,
          orderby: "createdon desc",
          top: params.top,
        });
    
        const jobs = result.value as Array<Record<string, unknown>>;
        const statusSummary: Record<string, number> = {};
        for (const job of jobs) {
          const statusName = SYSTEM_JOB_STATUS[job.statuscode as number] || `Unknown (${job.statuscode})`;
          statusSummary[statusName] = (statusSummary[statusName] || 0) + 1;
        }
    
        const failedJobs = jobs.filter((j) => j.statuscode === 31);
    
        return {
          content: [
            {
              type: "text" as const,
              text: `## Performance de Workflows/Processos\n\n**Resumo de Status:**\n${Object.entries(statusSummary).map(([status, count]) => `- ${status}: ${count}`).join("\n")}\n\n**Jobs com Falha:** ${failedJobs.length}\n${failedJobs.slice(0, 5).map((j) => `- **${j.name}**: ${j.friendlymessage || j.message || "Sem mensagem"}`).join("\n")}\n\n**Detalhes:**\n${JSON.stringify(jobs.slice(0, 10), null, 2)}`,
            },
          ],
        };
      }
    );
  • Input validation schema for the workflow performance tool.
    export const GetWorkflowPerformanceSchema = z.object({
      top: z.number().default(20),
      statusFilter: z.enum(["all", "succeeded", "failed", "waiting", "suspended", "cancelled"]).default("all"),
    });
  • Registration function that takes the server instance and registers the tools including dynamics_get_workflow_performance.
    export function registerTelemetryTools(
      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 the tool analyzes performance and status, implying a read-only operation, but does not specify whether it requires authentication, has rate limits, returns paginated results, or details the output format. This leaves significant gaps in understanding how the tool behaves.

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 directly states the tool's purpose without unnecessary words. It is appropriately sized and front-loaded, 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 analyzing workflows and processes, the lack of annotations, no output schema, and low schema description coverage, the description is incomplete. It does not provide enough context for an agent to understand the tool's behavior, output, or how it fits among sibling tools, making it inadequate for effective 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?

The description does not mention any parameters, while the input schema has 2 parameters with 0% schema description coverage. Since schema coverage is low, the description should compensate but does not, leaving parameters undocumented. However, one parameter has an enum ('statusFilter') that provides some semantic clarity, and there are no required parameters, so a baseline score of 3 is appropriate as the schema offers minimal but not zero information.

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 'Analisa performance e status de workflows e processos automáticos' clearly states the tool's purpose in Portuguese as analyzing performance and status of workflows and automated processes. It uses specific verbs ('analisa') and resources ('workflows e processos automáticos'), but does not explicitly differentiate from sibling tools like 'dynamics_get_active_processes' or 'dynamics_get_system_jobs', which might have overlapping functions.

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. It does not mention any context, prerequisites, or exclusions, leaving the agent to infer usage based on the name and description alone, which is insufficient given the many sibling tools in this domain.

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