Skip to main content
Glama

Explain a failed flow run

cs_explain_flow_run

Explain why a cloud flow run failed: resolve the broken action's real error, classify it as connector, expression, or timeout, and return inputs plus upstream outputs.

Instructions

Why one run of a cloud flow failed, in terms of the action that broke and what it was given. For each failed action it resolves the real error message - a failed connector action carries no error of its own, so the message is fetched from the action's outputs - classifies the failure as a connector, expression or timeout problem, and returns the inputs it was called with plus the outputs of the actions that ran just before it. Read-only. Start here when cs_list_flow_runs shows a failure. Uses the Power Automate service (cs_login scope 'flow'). Unverified against a live tenant.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
runIdYesRun id (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.
environmentIdNoPower Platform environment id (GUID). Defaults to workspace sync metadata or CPS_ENVIRONMENT_ID.
includeInputsNoFetch each failed action's inputs as well; default true
upstreamCountNoSucceeded actions to include with their outputs, ending at the first failure; default 3

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.1/5.0
Behavior4/5

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

With no annotations at all, the description carries the whole burden and does so well: it declares read-only, explains the non-obvious mechanic that a failed connector action carries no error of its own and the message must be fetched from the action's outputs, names the required auth scope (cs_login scope 'flow'), and honestly flags 'Unverified against a live tenant.' It stops short of rate limits or what happens when a run did not fail.

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?

Four sentences, front-loaded with the purpose before the mechanism, trigger, auth and caveat. Dense but every sentence carries information; the mid-sentence clause on error resolution is the only slightly heavy part.

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

Completeness4/5

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

No output schema exists, and the description adequately sketches the return payload (resolved error message, classification, action inputs, upstream outputs) plus auth and trigger context. It omits only edge behavior such as what is returned or raised when the run did not fail, which is minor for a diagnostic tool.

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%, so the schema already documents all eight parameters including defaults; baseline is 3. The description adds only soft meaning for includeInputs and upstreamCount by describing the returned inputs/upstream outputs, but no format, syntax or selection guidance beyond the schema's own defaults.

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 (explain) plus resource (one flow run) and scopes it precisely: 'why one run of a cloud flow failed, in terms of the action that broke and what it was given.' That framing distinguishes it from cs_get_flow_run (raw run data), cs_analyze_flow_health (aggregate health) and cs_compare_flow_runs (diffing), which an agent can see 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?

Gives an explicit entry condition: 'Start here when cs_list_flow_runs shows a failure,' which routes the agent from a sibling cleanly. However it names no exclusions or alternative diagnostic tools (e.g. health analysis for recurring/aggregate failures), so it is clear context without full when-not guidance.

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