Skip to main content
Glama

explain_failure

Re-run a single failing test at high verbosity to return its failure reason, decoded trace, backtrace, logs, and fuzz or invariant counterexample.

Instructions

Re-run one test at high verbosity and return only that test: its reason, decoded call trace (trimmed to the path to the revert when long), backtrace, logs and, for fuzz or invariant tests, the counterexample. Pass the test name as run_tests reports it, e.g. "BankTest.test_transfer()".

Input Schema

NameRequiredDescriptionDefault
testYesTest function, optionally with its contract: "Contract.test_name()".
contractNoTest contract, if not given in `test`.
max_bytesNoResponse size budget in bytes (default 8192).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations, the description carries the full load and does so well: it discloses that the test is re-executed, that output is filtered to that single test, that the decoded call trace is trimmed to the path to the revert when long, and that fuzz/invariant tests yield a counterexample. It omits cost/side-effect implications of re-running and any permission notes, keeping it short of a 5.

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?

Two dense sentences with no filler; the core action leads and the naming requirement closes. Every clause adds something an agent would otherwise have to guess.

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?

With no output schema, the description takes on the burden of explaining return contents and does — reason, trimmed call trace, backtrace, logs, counterexample. It stops short of describing the `max_bytes` budget or `contract` override, though both are documented in the schema.

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; the description still adds real value by giving a concrete format example ('BankTest.test_transfer()') and tying the naming convention to what run_tests emits. It does not mention `contract` or `max_bytes`, which remain schema-only.

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 ('Re-run one test at high verbosity and return only that test') and immediately scopes it against the sibling run_tests, which runs whole suites. An agent can tell exactly what this produces without opening the 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?

Guidance is implicit but strong: this is the drill-down step after run_tests reports a failure, and the description tells the caller to pass the test name 'as run_tests reports it'. It lacks an explicit 'use run_tests instead when...' exclusion, but the relationship to the sibling is clear enough to route correctly.

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