Skip to main content
Glama

Compare a failed flow run with one that worked

cs_compare_flow_runs

Compares a failed flow run against a successful baseline to separate data problems from logic problems, naming divergence points and differing action statuses.

Instructions

Diff a failed run against a successful one to separate a data problem from a logic problem. Names the action where the two runs part company, lists every action whose status differs, and flags actions present in one run but not the other, which means the definition changed between them. With compareTriggerData it also reports which top-level keys of the trigger payload differ (key names only, never the values). The baseline defaults to the most recent successful run. Read-only. Uses the Power Automate service (cs_login scope 'flow'). Unverified against a live tenant.

Input Schema

NameRequiredDescriptionDefault
runIdYesThe failed run (cs_list_flow_runs)
flowIdYesFlow id (cs_list_flows)
clientIdNoEntra app (client) id for MSAL. Defaults to CPS_CLIENT_ID, then the first-party VS Code id.
tenantIdNoEntra tenant id. Defaults to the workspace sync metadata, then CPS_TENANT_ID.
workspaceNoPath to (or inside) the agent workspace. Defaults to CPS_WORKSPACE or the current directory.
searchRunsNoHow far back to look for a successful baseline; default 50
baselineRunIdNoRun to compare against; default the most recent successful one
environmentIdNoPower Platform environment id (GUID). Defaults to workspace sync metadata or CPS_ENVIRONMENT_ID.
compareTriggerDataNoAlso compare what the trigger handed each run

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.1.8
    • removedInput schema / additionalProperties
      Removed value: -false
  2. Addedv0.1.6

TDQS

A4.6/5.0
Behavior5/5

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

With no annotations present, the description carries the full burden and does so: declares read-only, names the backing service and cs_login scope 'flow', discloses the baseline-selection default, and warns it is unverified against a live tenant. It also reveals output semantics, including that trigger-data comparison reports key names only and never values.

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 the purpose in the first sentence, then output semantics, then caveats. Every sentence contributes, though the middle sentence stacking three output behaviors is dense and could be trimmed slightly.

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?

For a no-annotation, no-output-schema compare tool, the description covers purpose, output shape, defaults, auth scope, and a verification caveat, leaving nothing an agent needs to invoke it correctly. No return-schema explanation is required since the properties are described inline.

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 coverage is 100%, so the baseline is 3, but the description adds real meaning beyond it: compareTriggerData is qualified as key-names-only (never values) and the baseline default is restated as behavior rather than a field. The remaining auth/workspace parameters are left to the schema.

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?

Names a specific operation (diff a failed run against a successful one) on specific resources, and spells out exactly what it produces: the diverging action, status-differing actions, and actions unique to one run. This is clearly distinguishable from siblings like cs_explain_flow_run or cs_get_flow_run without opening any 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?

States the diagnostic context clearly (separate a data problem from a logic problem) and explains the baseline default (most recent successful run) plus the searchRuns window. It doesn't explicitly name or exclude the adjacent tools (cs_explain_flow_run, cs_analyze_flow_health), so the routing is implied rather than enumerated.

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

Deploy Server

Other Tools