Skip to main content
Glama

decode_tx

Decode any mainnet transaction by hash on Base, Ethereum, or Solana. Returns structured fields like value, gas, status, and calldata for EVM or slot, fee, signers for Solana.

Instructions

Structured decode of any mainnet transaction by hash. Supply chain ('base' | 'ethereum' | 'solana') and tx_hash. Returns from/to/value/gas/status/calldata for EVM, or slot/fee/signers/program_calls for Solana. Mined txs cached in-process. Use for tx inspection, audit, agent UX (rendering tx summaries to users). $0.001 USDC.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
chainYes
tx_hashYesEVM 0x+64hex or Solana base58 signature.

Implementation Reference

  • Tool definition and inputSchema for 'decode_tx'. Defines the tool name, description, and input schema requiring 'chain' (enum: base, ethereum, solana) and 'tx_hash' (string).
    {
      name: "decode_tx",
      description:
        "Structured decode of any mainnet transaction by hash. Supply chain ('base' | 'ethereum' | 'solana') and tx_hash. Returns from/to/value/gas/status/calldata for EVM, or slot/fee/signers/program_calls for Solana. Mined txs cached in-process. Use for tx inspection, audit, agent UX (rendering tx summaries to users). $0.001 USDC.",
      inputSchema: {
        type: "object",
        properties: {
          chain: { type: "string", enum: ["base", "ethereum", "solana"] },
          tx_hash: { type: "string", description: "EVM 0x+64hex or Solana base58 signature." },
        },
        required: ["chain", "tx_hash"],
      },
    },
  • index.js:68-200 (registration)
    The TOOLS array containing all 9 tool definitions including 'decode_tx'. This array is registered via ListToolsRequestSchema handler.
    const TOOLS = [
      {
        name: "anchor_hash",
        description:
          "Anchor a 32-byte hash to BOTH Base mainnet (as EIP-1559 calldata) and Solana mainnet (via the Memo program) in a single call. Returns both transaction hashes plus block-explorer URLs as cryptographic proof of when the hash existed. Pure infrastructure — no opinions about content. Use for DAO vote receipts, AI decision attestations, contract notarization, scientific data integrity, audit trails. $0.005 USDC.",
        inputSchema: {
          type: "object",
          properties: {
            hash: {
              type: "string",
              description: "Pre-computed 32-byte hex hash (64 chars, no 0x prefix). Mutually exclusive with `data`.",
            },
            data: {
              description: "Arbitrary JSON to be canonicalized + SHA-256'd by the server. Mutually exclusive with `hash`.",
            },
            note: {
              type: "string",
              description: "Optional 200-char note included in the response (NOT on-chain).",
            },
          },
        },
      },
      {
        name: "screen_wallet",
        description:
          "Sanctions + AML screening for any EVM or Solana wallet address. Returns sanctions match (boolean), specific OFAC SDN programs flagged (Tornado Cash, Lazarus Group, Hydra Market, Garantex, Blender.io etc.), inferred chain, and a low/medium/high risk verdict. Use for AML pre-flight checks before any treasury transfer, KYC onboarding, vendor diligence, payroll wallet verification, marketplace counterparty checks. $0.001 USDC.",
        inputSchema: {
          type: "object",
          properties: {
            wallet: {
              type: "string",
              description: "EVM 0x… address (40 hex) or Solana base58 pubkey.",
            },
          },
          required: ["wallet"],
        },
      },
      {
        name: "attest_decision",
        description:
          "Verify a wallet signature over (input_hash, output_hash, decision) with domain separation, then dual-chain anchor the resulting Merkle root on Base and Solana mainnet. Returns the verified signer plus on-chain proof URLs. Use when an AI agent's decision needs a cryptographic, auditable receipt — autonomous trade approvals, AI-assisted contract decisions, model-output attestation for liability records. $0.010 USDC.",
        inputSchema: {
          type: "object",
          properties: {
            input_hash: { type: "string", description: "64-char hex SHA-256 of the agent's input." },
            output_hash: { type: "string", description: "64-char hex SHA-256 of the agent's output / decision payload." },
            decision: { type: "string", description: 'Free-form short label, e.g. "APPROVED", "REJECTED", "CONFIDENCE=0.93" (max 64 chars).' },
            scheme: { type: "string", enum: ["eip191", "ed25519"], description: "Signature scheme." },
            signature: { type: "string", description: "0x-prefixed hex (eip191) or base58 (ed25519)." },
            signer_pubkey: { type: "string", description: "Required for ed25519 (Solana base58 pubkey)." },
          },
          required: ["input_hash", "output_hash", "decision", "scheme", "signature"],
        },
      },
      {
        name: "decode_tx",
        description:
          "Structured decode of any mainnet transaction by hash. Supply chain ('base' | 'ethereum' | 'solana') and tx_hash. Returns from/to/value/gas/status/calldata for EVM, or slot/fee/signers/program_calls for Solana. Mined txs cached in-process. Use for tx inspection, audit, agent UX (rendering tx summaries to users). $0.001 USDC.",
        inputSchema: {
          type: "object",
          properties: {
            chain: { type: "string", enum: ["base", "ethereum", "solana"] },
            tx_hash: { type: "string", description: "EVM 0x+64hex or Solana base58 signature." },
          },
          required: ["chain", "tx_hash"],
        },
      },
      {
        name: "resolve_name",
        description:
          "Cross-chain name resolution. Pass a name like 'vitalik.eth' or 'bonfida.sol' and get back the resolved address(es) across supported registries. Currently supports ENS (.eth) and Bonfida SNS (.sol). Cached 1h server-side. $0.001 USDC.",
        inputSchema: {
          type: "object",
          properties: {
            name: { type: "string", description: "Human-readable name, e.g. 'vitalik.eth' or 'bonfida.sol'." },
          },
          required: ["name"],
        },
      },
      {
        name: "token_price",
        description:
          "USD spot price for any major token. Pass either `symbol` (BTC, ETH, SOL, USDC, etc.) OR (chain + contract). Returns USD price, 24h change percent, market cap, fetched-at timestamp. CoinGecko-backed, cached 60s. $0.001 USDC.",
        inputSchema: {
          type: "object",
          properties: {
            symbol: { type: "string", description: "Token symbol like 'ETH'. Mutually exclusive with chain+contract." },
            chain: { type: "string", description: "Chain slug: base, ethereum, solana, polygon, arbitrum, optimism, bsc, avalanche." },
            contract: { type: "string", description: "Token contract address. Required with chain." },
          },
        },
      },
      {
        name: "decode_calldata",
        description:
          "Decode raw EVM calldata into a human-readable function name, canonical signature, and typed parameter values. Resolves the 4-byte selector against openchain.xyz's signature directory, then ABI-decodes the args. Use for tx inspection before signing, mempool analysis, debug. EVM-only (chain='ethereum'); 'solana' returns 400. $0.001 USDC.",
        inputSchema: {
          type: "object",
          properties: {
            chain: { type: "string", enum: ["ethereum", "solana"], description: "EVM-only; 'solana' returns 400." },
            calldata_hex: { type: "string", description: "Raw EVM calldata (>=4 byte selector), with or without 0x prefix." },
            contract_address: { type: "string", description: "Optional. Reserved for future on-chain ABI lookups." },
          },
          required: ["chain", "calldata_hex"],
        },
      },
      {
        name: "parse_datetime",
        description:
          "Parse any freeform datetime string ('tomorrow at noon', 'yesterday', '2026-05-13T15:30Z', 'in 2 hours') into a fully structured normalized form: ISO 8601, unix epoch, components (year/month/day/hour/min/sec/weekday), relative seconds + human form, confidence score. Saves agent LLM tokens on date parsing. $0.001 USDC.",
        inputSchema: {
          type: "object",
          properties: {
            input: { type: "string", description: "Freeform datetime string." },
            base_time: { type: "string", description: "Optional ISO 8601 reference; defaults to now UTC." },
            timezone: { type: "string", description: "Optional IANA tz name (e.g. 'America/New_York'); defaults to UTC." },
          },
          required: ["input"],
        },
      },
      {
        name: "intel_wallet",
        description:
          "Unified wallet intelligence bundle. ONE call returns balances on Base + Ethereum + Solana, USDC across chains, transaction count, ENS/SNS reverse lookup, and sanctions verdict — all aggregated from 8–10 parallel free public sources. Replaces a wallet-investigation script with a single $0.005 call. Use for KYB pre-flight, counterparty research, fraud detection. $0.005 USDC.",
        inputSchema: {
          type: "object",
          properties: {
            wallet: { type: "string", description: "EVM 0x… address (40 hex) or Solana base58 pubkey." },
          },
          required: ["wallet"],
        },
      },
    ];
  • Handler case in buildRequest() for 'decode_tx'. Constructs a POST request to `${BASE_URL}/v1/decode/tx` with JSON body containing chain and tx_hash arguments.
    case "decode_tx":
      return {
        url: `${BASE_URL}/v1/decode/tx`,
        opts: {
          method: "POST",
          headers: { "Content-Type": "application/json" },
          body: JSON.stringify({ chain: args.chain, tx_hash: args.tx_hash }),
        },
      };
  • The CallToolRequestSchema handler that invokes buildRequest() and executes the paidFetch call for all tools including 'decode_tx'.
    server.setRequestHandler(CallToolRequestSchema, async (request) => {
      const { name, arguments: args = {} } = request.params;
      let req;
      try {
        req = buildRequest(name, args);
      } catch (err) {
        return {
          content: [{ type: "text", text: `Error: ${err.message}` }],
          isError: true,
        };
      }
    
      try {
        const res = await paidFetch(req.url, req.opts);
    
        if (res.status === 402) {
          const body = await res.text().catch(() => "");
          const msg = paymentEnabled
            ? `Payment failed (402). The wallet may be out of USDC on Base, or the x402 facilitator rejected the payload.\n\nResponse body: ${body.slice(0, 300)}`
            : `Payment required (402). Set ANCHOR_WALLET_PRIVATE_KEY in your MCP config so this server can pay automatically:\n\n  "env": {\n    "ANCHOR_WALLET_PRIVATE_KEY": "0xYOUR_BASE_WALLET_PRIVATE_KEY"\n  }\n\nFund the wallet with USDC on Base (any amount > $0.05 is plenty). The wallet pays $0.001–$0.010 per call.\n\nResponse body: ${body.slice(0, 300)}`;
          return { content: [{ type: "text", text: msg }], isError: true };
        }
    
        if (!res.ok) {
          const body = await res.text().catch(() => "");
          return {
            content: [{ type: "text", text: `anchor-x402 returned ${res.status}: ${body.slice(0, 500)}` }],
            isError: true,
          };
        }
    
        const data = await res.json();
        return {
          content: [{ type: "text", text: JSON.stringify(data, null, 2) }],
        };
      } catch (err) {
        return {
          content: [{ type: "text", text: `anchor-x402 request failed: ${err.message}` }],
          isError: true,
        };
      }
    });
Behavior3/5

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

With no annotations, description provides some behavioral info: 'Mined txs cached in-process' and pricing ($0.001). However, it does not disclose authentication requirements, rate limits, or error conditions, leaving gaps.

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?

Three sentences, front-loaded with the core action. No redundant information. However, could be slightly more structured by separating output details from pricing.

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?

Given the simple schema and no output schema, the description covers inputs, outputs (per chain), use cases, caching, and pricing. It is sufficiently complete for an agent to decide and invoke correctly.

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 coverage is 50% (only tx_hash described). The tool description reiterates that chain is from the given enum list and tx_hash is the hash, adding minimal value beyond schema. It does not explain what the returned fields mean in detail.

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?

Clearly states it decodes a mainnet transaction by hash, specifying the input requirements (chain and hash) and output fields per chain. Differentiates from sibling tools like decode_calldata which only decode calldata, not full transactions.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

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

Provides examples of use cases (tx inspection, audit, agent UX) but does not explicitly state when not to use it or mention alternatives. Lacks guidance on when to prefer this over decode_calldata for calldata-only needs.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/hypeprinter007-stack/anchor-x402-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server