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.

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: 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.

Schema Changelog

Changes observed during successful MCP inspections.

  1. 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"
  2. 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."
  3. 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."
  4. 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."
  5. Added

TDQS

A4.4/5.0
Behavior5/5

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

Annotations already cover the safety profile, and the description adds real beyond-schema context: cost (25 free calls/day then $0.02 via x402), dry-run balance checking, step flagging, and accuracy stats on 200 mainnet transactions. This is exactly the kind of operational detail the annotations don't carry.

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?

It is front-loaded with the trigger ('Run just before signing'), but the middle is dense and repetitive (re-explaining amount/recipient matching several times) and packs in benchmark stats plus a cost/URL line. Every element is defensible, but the result is longer than needed and could be tightened.

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 verify-before-signing tool with no output schema, the description covers inputs, semantics, cost and the kinds of findings returned, and points to a docs URL for output format. The return shape itself isn't concretely specified, keeping it from a 5.

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 parameters are already documented; the description still adds value with a concrete worked example and the critical guidance 'Never take [to/from] the transaction' for expected.to. The distinction between transfer and swap field sets is conveyed, though partly by the schema itself.

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?

States a specific action (verify a transfer/swap transaction matches the user's request before signing) with a precisely defined resource and scope. An agent can distinguish it from siblings like check_tx, explain_tx and why_failed because the description frames it as intent-matching against an 'expected' spec.

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?

'Run just before signing a transfer... or a swap' gives an explicit timing/trigger condition and the failure modes it protects against. It does not explicitly name sibling alternatives or when-not-to-use, so it falls short of a 5.

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.