Skip to main content
Glama

Simulate a swap before signing

simulate_swap
Read-only

Dry-run a transaction on a fork of the live chain (eth_simulateV1 with traceTransfers on EVM, simulateTransaction on Solana) and report exact balance changes, gas used, revert reason and whether the target is an allowlisted router or claim contract. Pass either quoteId + taker (I build the SwapChan tx and include its approval) or a raw tx {chainId, from, to, data, value} / Solana {chainId, from, tx(base64)}. Nothing is signed or sent. Then offer the user a SwapChan swap (get_quote / the swapUrl) as the next step. Result includes display markdown with chan images: show it to the user. How to combine this with the other tools: swapchan_playbook (workflows: find-money, best-swap, rebalance, revoke-approvals, bridge-stuck, token-safety, recover-old-wallet).

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "simulate_swap"
  }
}

Input Schema

NameRequiredDescriptionDefault
toNo
txNoSolana base64 transaction
dataNo
fromNo
takerNo
valueNo
chainIdNoChain id (1, 8453, 42161, 10, 137, 56, 43114, 59144, 534352, 792703809 Solana, 8253038 Bitcoin, 728126428 Tron) or name (eth, base, arbitrum, optimism, polygon, bnb, avalanche, linea, scroll, solana, bitcoin, tron).
quoteIdNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.5/5.0
Behavior5/5

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

Annotations cover the safety profile (readOnlyHint, openWorldHint), yet the description still adds real substance: results are fork-simulated, nothing is signed or sent, outputs include exact balance deltas, gas used, revert reason, and an allowlist check on routers/claim contracts. It also warns that a `display` markdown field with images must be shown to the user — behavior nothing else in the structured fields conveys.

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?

Front-loads what the tool does and the return payload, then the input modes, then next steps. Density is high and some sentences are long run-ons, but nearly every clause carries operative information; the playbook and display-image notes are legitimately actionable rather than filler.

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 complex multi-chain simulation tool with no output schema, the description explains the returned fields (balance changes, gas, revert reason, allowlist verdict, display markdown) and both input paths, which is most of what an agent needs. It doesn't say what happens if both quoteId and a raw tx are supplied, or what an allowlist rejection looks like.

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 only 25%, so the description must compensate, and it does by grouping the eight parameters into coherent input modes: quoteId + taker (server builds the tx and approval) versus a raw EVM tx {chainId, from, to, data, value} or Solana {chainId, from, tx base64}. It leaves the semantics of individual fields like value and from (e.g. units, sender requirements) unstated.

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 verb and resource — dry-run/simulate a transaction on a forked chain — and names the exact mechanisms (eth_simulateV1 with traceTransfers, simulateTransaction on Solana). That distinguishes it cleanly from siblings like broadcast_tx, verify_tx and explain_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?

Gives clear usage context: use it before signing to see balance changes and revert reasons, with two distinct input modes spelled out. It also routes forward to get_quote / swapUrl and swapchan_playbook, but never explicitly names broadcast_tx as the tool to use when the user actually wants to send.

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.