Skip to main content
Glama

why_failed

Read-onlyIdempotent

Run whenever a Solana transaction or dry run fails, before retrying. Retrying blind burns fees. Turns a Solana error (hex code, log line or RPC error) into the plain cause and fix. Offline, no chain call. Example: {"error": "custom program error: 0x1771", "program": "JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4"}. Cost: 25 free calls a day, then $0.01 USDC per call (x402). Outputs explained: GET /api/tools/why_failed.

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": {
      "error": "<error>"
    },
    "name": "why_failed"
  }
}

Input Schema

NameRequiredDescriptionDefault
errorYesThe error 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 failing program. Needed to read custom error codes right. From the log line "Program <address> failed", or from explain_tx.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • changedInput schema / properties / error / description
      Previous 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."New value: +"The error 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."
    • changedInput schema / properties / program / description
      Previous value: -"The program that failed. Needed to read custom error codes correctly. From the log line \"Program <address> failed\", or from explain_tx."New value: +"The failing program. Needed to read custom error codes right. From the log line \"Program <address> failed\", or from explain_tx."
  2. 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."
  3. Added

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive and openWorld. The description adds genuine extra context beyond them: it runs offline with no chain call, and discloses the cost model (25 free calls/day, then $0.01 USDC per call via x402). It does not describe the return shape, but the cost and offline behavior are material facts.

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 trigger and the value proposition, followed by cost and a concrete example. Dense but every sentence carries signal, aside from the slightly cryptic closing "Outputs explained: GET /api/tools/why_failed."

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 compensates reasonably by explaining it maps errors to a cause and fix, discloses cost and offline behavior, and gives a worked example. It is complete enough to call correctly, though the return format remains unspecified.

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 both parameters are already fully documented in the schema. The inline example (error 0x1771 plus the JUP6 program address) illustrates the expected shape, which is marginally helpful, but the description adds little beyond what the schema provides. 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: it turns a Solana error (hex code, log line or RPC error) into the plain cause and fix. This clearly distinguishes it from siblings like explain_tx or check_tx, which analyze transactions rather than diagnose error codes.

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?

"Run whenever a Solana transaction or dry run fails, before retrying" gives an explicit trigger condition and timing (before retry). It does not name a specific alternative tool, so it falls short of full when-not/alternatives guidance.

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.