Skip to main content
Glama
power-automate-mcp

power-automate-mcp

by OwnOptic

analyze_flow_health

Read-only

Analyze recent Power Automate flow runs to measure reliability, failure rate, and duration, then rank failing actions and attribute sampled failure causes.

Instructions

Analyse a flow's recent run history: reliability, failure patterns, duration.

Answers the questions a single run cannot: is this flow flaky or broken? Which action fails most? Is it getting slower? The portal's analytics page shows counts but will not tell you WHICH action is responsible or group failures by cause.

last_n runs are analysed for statistics. Because action-level detail costs one request per run, only sample_failures of the failed runs are opened to attribute causes. The response says how many were sampled - do not read the tally as exhaustive.

Returns: total / succeeded / failed / cancelled / running failure_rate 0.0 to 1.0 over completed runs only duration_seconds {mean, p95, max} across successful runs failing_actions [{action, count, sample_error}] ranked, from the sampled failures verdict plain-language read of the numbers

A single action accounting for nearly all failures means a targeted fix. Failures spread across many actions usually means the trigger data or a connection, not the logic.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "flow_id": "<flow_id>"
    },
    "name": "analyze_flow_health"
  }
}

Input Schema

NameRequiredDescriptionDefault
last_nNo
flow_idYes
sample_failuresNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.1.0

TDQS

A4.6/5.0
Behavior5/5

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

Goes well beyond readOnlyHint=true by disclosing the cost model (one request per run for action-level detail) and the resulting sampling limitation, with an explicit warning not to read the tally as exhaustive. It also pins down metric definitions: failure_rate is over completed runs only, duration is across successful runs only, and failing_actions are ranked from sampled failures.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with purpose and the differentiating question, then a scannable Returns block, then an interpretive hint. It is longer than most, but the length is spent on the sampling caveat and metric definitions rather than filler; the parenthetical aside about the portal page is the only slightly padded element.

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

Completeness5/5

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

There is no output schema, and the description compensates by listing every returned field with its semantics, which is exactly what is needed here. Combined with the sampling caveat and the interpretation guidance for spread-vs-concentrated failures, an agent has everything required to call this correctly and read the result honestly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must carry the load, and it does for two of three parameters: last_n defines the analysis window and sample_failures is explained with its cost tradeoff and its effect on the reliability of failing_actions. flow_id is left to obvious inference, and the defaults (50 and 5) are only in the schema, not the prose.

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?

States a specific verb and resource (analyse a flow's recent run history) and enumerates the outputs it produces: reliability, failure patterns, duration. The line 'Answers the questions a single run cannot' implicitly separates it from explain_run/compare_runs, so an agent can place it without opening a schema.

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

Usage Guidelines4/5

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

Clearly frames the diagnostic use case (is this flow flaky or broken, which action fails most, is it getting slower) and contrasts it with the portal analytics page, which shows counts but not attribution. It lacks explicit sibling routing, e.g. it never names list_runs or explain_run as the alternative for per-run inspection, so the agent must infer the boundary.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.