Skip to main content
Glama

Decode a Solana program or JSON-RPC error (free)

decode_solana_error
Read-only

Decode a Solana custom program error or JSON-RPC server error from a hex code (0x1771), decimal code (6001), a line such as 'custom program error: 0x1771', a JSON-RPC code such as -32002, or a full program log. Returns every known program that defines that code, or a single exact match when a program id or slug is given, plus the Rugsight Solana Error Codes page URL. Free, no payment, no RPC, no API key. Same data as GET /api/errors/decode?q={error}&program={program_id}. Use when you have a failed transaction error, a program log, or a code and need the name, message and the /errors page for it.

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": "decode_solana_error"
  }
}

Input Schema

NameRequiredDescriptionDefault
errorYesError text, log excerpt, hex (0x1771), decimal code (6001), 'custom program error: 0x1771', a JSON-RPC code such as -32002, or a full log line.
program_idNoOptional Solana program id (base58) or Rugsight program slug (e.g. jupiter-v6) that raised the error. Narrows the match when the same code is used by more than one program.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.3/5.0
Behavior4/5

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

Annotations declare readOnlyHint=true and openWorldHint=false, and the description is consistent while adding real context: free, no payment, no RPC call, no API key required, and an explicit statement of what the response contains (all matching programs, or one exact match plus the Errors page URL). It also mirrors a REST endpoint (GET /api/errors/decode) which aids predictability. It stops short of describing failure behavior when a code is unknown or malformed.

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?

Two sentences, front-loaded with the accepted-input list and ending with the use case. Dense but each clause carries distinct information (formats, return shape, cost/auth constraints, REST parity). Slightly overloaded in one sentence with five comma-separated formats, but nothing is redundant.

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 only 2 parameters, no output schema, and clear annotations, the description covers inputs, output content, cost, and the endpoint equivalent — sufficient to invoke correctly. The remaining gap is edge-case behavior (unrecognized code, ambiguous matches without program_id), which for a read-only decoder is a minor omission.

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 baseline is 3. The description nevertheless adds meaning the schema doesn't spell out: the `program_id` parameter's live effect is 'a single exact match when a program id or slug is given' versus 'every known program that defines that code' otherwise, which is the key dispatch semantic for choosing whether to pass it.

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?

The description opens with a specific verb+resource ('Decode a Solana custom program error or JSON-RPC server error') and then enumerates the exact input forms accepted (0x1771, 6001, 'custom program error: 0x1771', -32002, full log). This is far more precise than any sibling (explain_tx, scan_wallet) and an agent can pick it unambiguously.

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?

It states a clear trigger: 'Use when you have a failed transaction error, a program log, or a code and need the name, message and the /errors page.' That covers the when-to-use side well. It does not, however, explicitly contrast against a sibling like explain_tx (e.g. 'use explain_tx for whole-transaction analysis, this for raw codes'), so routing among near-neighbours is left to inference.

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