Skip to main content
Glama

why_failed

Read-onlyIdempotent

Run whenever a Solana transaction or dry run fails, before retrying. Retrying without knowing why just burns fees. Turns a Solana error (hex code, log line or RPC error object) into the plain cause and the fix. Works offline, no chain call. Inputs: error: The error exactly as you got it: "custom program error: 0x1771", "InsufficientFundsForRent", or the RPC error object. program (optional): The program that failed. Needed to read custom error codes correctly. Cost: 25 free calls a day, then $0.01 USDC per call (x402). Full field-by-field docs: GET /api/tools/why_failed.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
errorYesThe error exactly as you got it: "custom program error: 0x1771", "InsufficientFundsForRent", or the RPC error object. From your send or RPC error, a dry-run result, a wallet message, or history.
programNoThe program that failed. Needed to read custom error codes correctly. From the log line "Program <address> failed", or from explain_tx.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedInput schema / properties / error / description
      Added value: +"The error exactly as you got it: \"custom program error: 0x1771\", \"InsufficientFundsForRent\", or the RPC error object. From your send or RPC error, a dry-run result, a wallet message, or history."
    • addedInput schema / properties / program / description
      Added value: +"The program that failed. Needed to read custom error codes correctly. From the log line \"Program <address> failed\", or from explain_tx."
  2. Added

TDQS

A4.6/5.0
Behavior5/5

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

Adds substantial context beyond the annotations: it works offline with no chain call, and carries an explicit cost model (25 free calls/day, then $0.01 USDC via x402). The pricing and offline behavior are exactly the kind of operational detail annotations cannot express.

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 usage trigger and payoff, then inputs and cost. Mostly tight, though the pricing and docs-pointer sentences add length that slightly dilutes the core signal.

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?

With no output schema, the description still conveys the return shape ("the plain cause and the fix") and covers inputs, offline behavior, and cost. Nothing an agent needs to invoke it correctly is missing.

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 both parameters fully. The description largely restates the schema's examples and guidance (error formats, program needed for custom codes) without adding new syntax or format meaning, so the baseline 3 applies.

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+resource (turns a Solana error into the plain cause and the fix) with clear scope, and distinguishes itself from siblings like explain_tx and check_tx by being the error-to-diagnosis tool. An agent can tell what it does 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 Guidelines5/5

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

Explicit trigger: "Run whenever a Solana transaction or dry run fails, before retrying," plus a rationale ("retrying without knowing why just burns fees"). It also points to explain_tx as a source for the program argument, giving routing context against siblings.

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.