Skip to main content
Glama

Explain a Solana program error code

explain_error

Looks up what a custom program error code means for a given program, using 1,800+ named errors from major Solana programs plus the runtime's own errors. Use it when you only have a code such as 6001 or 0x1771 from a simulation or an RPC response.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesError code as a number, or a hex string like 0x1771.
programIdYesBase58 address of the program that raised the error.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.8/5.0
Behavior3/5

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

With no annotations, the description carries the full burden. It usefully states the lookup's coverage (1,800+ named errors, major programs plus runtime errors), which tells the agent how authoritative the answer will be. However, it says nothing about read-only behavior, what happens for an unknown code, or whether programId matters for runtime errors.

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 sentences, zero waste, and the core purpose is front-loaded before the usage cue. Every clause earns its place by either defining the capability or qualifying the input it accepts.

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 two-parameter lookup with 100% schema coverage and no annotations, the description covers purpose, input shape, and data coverage. With no output schema, a brief note on the returned form (or behavior on an unknown code) would close the remaining gap, but nothing essential to invoking 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 both parameters are already documented, including the 'number or hex string like 0x1771' format. The description's re-use of 6001/0x1771 as examples adds only marginal reinforcement and no new syntax or constraint detail. Baseline 3 applies when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource: 'Looks up what a custom program error code means for a given program.' It also discloses the data backing the lookup (1,800+ named errors plus runtime errors). It doesn't name the sibling tools, but the 'when you only have a code' framing implicitly separates it from diagnose_transaction, which operates on a whole transaction.

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?

'Use it when you only have a code such as 6001 or 0x1771 from a simulation or an RPC response' gives a concrete triggering condition with example inputs. No explicit when-not or named alternative (e.g. diagnose_transaction) is given, so it stops short of full routing 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.

Resources