Skip to main content
Glama

tx_matches

Read-onlyIdempotent

Run just before signing a transfer built from a request like "send 5 USDC to X", or a swap built for "swap 1 USDC for JUP". Confirms it moves exactly that token, amount and recipient, nothing more, or that the swap sells exactly that amount and pays the bought token back to you. Catches made-up amounts, wrong decimals, hidden steps and swaps that pay someone else. Compares the transaction with your request (token, exact amount, recipient, sender), flags every step that isn't the transfer, and checks dry-run balances so money moved any other way is caught. For a swap it reads the dry run: exactly the amount sold, the bought token reaching your wallet, and nothing else leaving it. Measured on 200 real mainnet transactions: 80 of 80 transfers and 26 of 27 swaps matched (the other paid a bot 1.54%). Example: "send 1 USDC to X" is {"tx": "", "expected": {"token": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v", "amount": "1", "to": "X"}}. Cost: 25 free calls a day, then $0.02 USDC per call (x402). Outputs explained: GET /api/tools/tx_matches.

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": {
      "tx": "<tx>",
      "expected": "<expected>"
    },
    "name": "tx_matches"
  }
}

Input Schema

NameRequiredDescriptionDefault
txYesBase64 transaction, signed or not, legacy, v0 or v1. Before signing: Buffer.from(tx.serialize({ requireAllSignatures: false })).toString('base64'), or an aggregator's swap tx.
networkNoDefault "mainnet-beta" (real money). "devnet" only for test wallets.mainnet-beta
expectedYesaction: Default "transfer". "swap" takes sell, amount, buy and from instead of token, amount and to. From the request you were given. token: Transfers (required): the token to send. "SOL", or the token address from find_token. amount: Normal units (for a swap: the amount sold): "5" means 5 USDC. The user's amount, as a string. to: Transfers (required): the person's wallet, not their token account. The address the user gave you. Never take it from the transaction. from: The wallet that pays (for a swap: sells and gets the bought token). Default: the fee payer. Your agent's wallet address. sell: Swaps (required): the token sold. "SOL", or the token address from find_token. buy: Swaps (required): the token bought. "SOL", or the token address from find_token. Never take it from the transaction.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / expected / description
      Previous value: -"action: Default \"transfer\". \"swap\" takes sell, amount, buy and from instead of token, amount and to. From the request you were given. token: The token to send. \"SOL\", or the token address from find_token. amount: Normal units (for a swap: the amount sold): \"5\" means 5 USDC. The user's amount, as a string. to: The person's wallet, not their token account. The address the user gave you. Never take it from the transaction. from: The wallet that pays (for a swap: sells and gets the bought token). Default: the fee payer. Your agent's wallet address. sell: Swaps only: the token sold. \"SOL\", or the token address from find_token. buy: Swaps only: the token bought. \"SOL\", or the token address from find_token. Never take it from the transaction."New value: +"action: Default \"transfer\". \"swap\" takes sell, amount, buy and from instead of token, amount and to. From the request you were given. token: Transfers (required): the token to send. \"SOL\", or the token address from find_token. amount: Normal units (for a swap: the amount sold): \"5\" means 5 USDC. The user's amount, as a string. to: Transfers (required): the person's wallet, not their token account. The address the user gave you. Never take it from the transaction. from: The wallet that pays (for a swap: sells and gets the bought token). Default: the fee payer. Your agent's wallet address. sell: Swaps (required): the token sold. \"SOL\", or the token address from find_token. buy: Swaps (required): the token bought. \"SOL\", or the token address from find_token. Never take it from the transaction."
  2. Changed5 schema fields changed
    • addedInput schema / properties / expected / anyOf
      Added value: +[
      +  {
      +    "properties": {
      +      "action": {
      +        "const": "swap",
      +        "type": "string"
      +      },
      +      "amount": {
      +        "type": "string"
      +      },
      +      "buy": {
      +        "type": "string"
      +      },
      +      "from": {
      +        "type": "string"
      +      },
      +      "sell": {
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "action",
      +      "sell",
      +      "amount",
      +      "buy"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "properties": {
      +      "action": {
      +        "const": "transfer",
      +        "type": "string"
      +      },
      +      "amount": {
      +        "type": "string"
      +      },
      +      "from": {
      +        "type": "string"
      +      },
      +      "to": {
      +        "type": "string"
      +      },
      +      "token": {
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "token",
      +      "amount",
      +      "to"
      +    ],
      +    "type": "object"
      +  }
      +]
    • changedInput schema / properties / expected / description
      Previous value: -"token: The token to send. \"SOL\", or the token address from find_token. amount: Normal units: \"5\" means 5 USDC. The user's amount, as a string. to: The person's wallet, not their token account. The address the user gave you. Never take it from the transaction. from: The wallet that pays. Default: the fee payer. Your agent's wallet address."New value: +"action: Default \"transfer\". \"swap\" takes sell, amount, buy and from instead of token, amount and to. From the request you were given. token: The token to send. \"SOL\", or the token address from find_token. amount: Normal units (for a swap: the amount sold): \"5\" means 5 USDC. The user's amount, as a string. to: The person's wallet, not their token account. The address the user gave you. Never take it from the transaction. from: The wallet that pays (for a swap: sells and gets the bought token). Default: the fee payer. Your agent's wallet address. sell: Swaps only: the token sold. \"SOL\", or the token address from find_token. buy: Swaps only: the token bought. \"SOL\", or the token address from find_token. Never take it from the transaction."
    • removedInput schema / properties / expected / properties
      Removed value: -{
      -  "action": {
      -    "const": "transfer",
      -    "type": "string"
      -  },
      -  "amount": {
      -    "type": "string"
      -  },
      -  "from": {
      -    "type": "string"
      -  },
      -  "to": {
      -    "type": "string"
      -  },
      -  "token": {
      -    "type": "string"
      -  }
      -}
    • removedInput schema / properties / expected / required
      Removed value: -[
      -  "token",
      -  "amount",
      -  "to"
      -]
    • removedInput schema / properties / expected / type
      Removed value: -"object"
  3. Changed1 schema field changed
    • changedInput schema / properties / tx / description
      Previous value: -"Base64 transaction, signed or not, legacy or v0. Before signing: Buffer.from(tx.serialize({ requireAllSignatures: false })).toString('base64'), or an aggregator's swap tx."New value: +"Base64 transaction, signed or not, legacy, v0 or v1. Before signing: Buffer.from(tx.serialize({ requireAllSignatures: false })).toString('base64'), or an aggregator's swap tx."
  4. Changed3 schema fields changed
    • changedInput schema / properties / expected / description
      Previous value: -"token: The token that should be sent. amount: How much should be sent, in normal units. \"5\" means 5 USDC. to: The wallet that should get it (the person, not their token account). from: The wallet that should pay. Default: the transaction's fee payer."New value: +"token: The token to send. \"SOL\", or the token address from find_token. amount: Normal units: \"5\" means 5 USDC. The user's amount, as a string. to: The person's wallet, not their token account. The address the user gave you. Never take it from the transaction. from: The wallet that pays. Default: the fee payer. Your agent's wallet address."
    • changedInput schema / properties / network / description
      Previous value: -"Which Solana network to read. Default \"mainnet-beta\" (real money). Leave it out for mainnet. Use \"devnet\" only for test wallets."New value: +"Default \"mainnet-beta\" (real money). \"devnet\" only for test wallets."
    • changedInput schema / properties / tx / description
      Previous value: -"The transaction, base64-encoded. Signed or not. Legacy and v0 both work. From your wallet SDK before signing: Buffer.from(tx.serialize({ requireAllSignatures: false })).toString('base64'). Or the swap transaction an aggregator API gave you."New value: +"Base64 transaction, signed or not, legacy or v0. Before signing: Buffer.from(tx.serialize({ requireAllSignatures: false })).toString('base64'), or an aggregator's swap tx."
  5. Changed3 schema fields changed
    • addedInput schema / properties / expected / description
      Added value: +"token: The token that should be sent. amount: How much should be sent, in normal units. \"5\" means 5 USDC. to: The wallet that should get it (the person, not their token account). from: The wallet that should pay. Default: the transaction's fee payer."
    • addedInput schema / properties / network / description
      Added value: +"Which Solana network to read. Default \"mainnet-beta\" (real money). Leave it out for mainnet. Use \"devnet\" only for test wallets."
    • addedInput schema / properties / tx / description
      Added value: +"The transaction, base64-encoded. Signed or not. Legacy and v0 both work. From your wallet SDK before signing: Buffer.from(tx.serialize({ requireAllSignatures: false })).toString('base64'). Or the swap transaction an aggregator API gave you."
  6. Added

TDQS

A4.5/5.0
Behavior5/5

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

Annotations only declare read-only/idempotent safety; the description goes well beyond by disclosing what is compared, that non-target steps are flagged, that dry-run balances are checked, measured accuracy on 200 mainnet transactions (80/80 transfers, 26/27 swaps), and the pricing model (25 free calls/day, then $0.02 USDC via x402).

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The opening two sentences are well front-loaded, but the middle section restates the same checks three times (extra steps, someone else paid, nothing else leaving the wallet), and the trailing 'Outputs explained: GET /api/tools/tx_matches' is low-value. Dense but with noticeable redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a verification tool with no output schema, the description covers purpose, both input modes, parameter sourcing rules, a concrete example, cost limits, and reliability evidence — everything an agent needs to call it correctly.

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 already 100%, so the baseline is 3, but the description adds real meaning: 'never take the recipient from the transaction', 'never take the bought token from the transaction', that amounts are in normal units as strings, and a worked example payload. It does not explain the devnet/network tradeoff beyond the schema's own text.

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 names a specific operation (verify a transaction against an intended request) with concrete sub-checks: exact token, exact amount, recipient, and dry-run balance deltas. It covers both modes (transfer and swap) and is distinguishable from generic inspection siblings by the 'just before signing' framing.

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 gives clear timing guidance ('Run just before signing a transfer built from a request like ...') and covers the swap case. It does not explicitly name an alternative tool or state when not to use it, 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.