Skip to main content
Glama

Find out why a run failed

diagnose_run
Read-onlyIdempotent

Why a workflow or agent run failed or is stuck (out of credits, an app connection, a rate limit, a timeout, wrong inputs, a step reading a missing value and so on), what to do about it, and whether running it again may help. Free: it reads the run, it does not run anything.

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": {
      "run_id": "<run_id>"
    },
    "name": "diagnose_run"
  }
}

Input Schema

NameRequiredDescriptionDefault
run_idYesThe run_id or request id.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already cover read-only, idempotent, non-destructive, and closed-world traits, and the description adds genuinely new context: the call is free and performs no execution, so the agent knows there is no side-effect or cost risk. The enumeration of diagnosable failure classes also sets expectations about what the analysis covers, though it says nothing about latency or output shape.

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?

One front-loaded sentence delivers the purpose, the failure taxonomy, the actionable output, and the read-only guarantee. The parenthetical list is slightly long but each item is a distinct, useful cause category rather than filler.

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?

For a single-parameter read-only tool with no output schema, the description usefully previews what comes back — a diagnosis, a recommended remedy, and rerun advice. That covers the main information an agent needs before calling, with only minor gaps around output format.

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?

With a single required parameter at 100% schema coverage, the schema already explains that run_id is 'the run_id or request id'. The description reinforces that the tool reads an existing run rather than creating one, but adds no further format or identifier guidance beyond 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?

The description names a specific resource (a workflow or agent run) and a specific job: explaining why it failed or is stuck, what to do, and whether a rerun helps. The closing clause 'it reads the run, it does not run anything' separates it from action-oriented siblings like retry_run and run_workflow.

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?

It clearly states the triggering condition — a run that failed or is stuck — and enumerates concrete cause categories (credits, app connection, rate limit, timeout, bad inputs). It stops short of naming an alternative tool by name for the rerun path, but 'whether running it again may help' implies the boundary with retry tools.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources