why_failed
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
| Name | Required | Description | Default |
|---|---|---|---|
| error | Yes | 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. | |
| program | No | The failing program. Needed to read custom error codes right. From the log line "Program <address> failed", or from explain_tx. |