Skip to main content
Glama

Simulate a swap

simulate_swap
Read-onlyIdempotent

Build and dry-run a token swap from a given account via eth_call, returning the plan and simulation without signing or sending.

Instructions

Build the swap, then dry-run it from the given account with an eth_call on your node. Returns the plan and the simulation. Nothing is signed or sent.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fromYesthe account the simulation runs from
chainNobase | eth | optimism | arbitrum | robinhood, or a numeric chain id. Optional when your RPC has a single chain.
amountNoinput amount in human units, for example "1.5"
tokenInYesinput token: a 0x address, or a symbol such as ETH, WETH, USDC, BZPX
versionNoprotocol version: latest (default) | 1 | 2 | 2.0.0
amountInNoinput amount in base units, as an integer string
tokenOutYesoutput token: a 0x address, or a symbol such as ETH, WETH, USDC, BZPX
recipientYeswho receives tokenOut
userMinOutNooptional explicit minimum output, in base units of tokenOut
deadlineSecNodeadline horizon in seconds, 10-3600, default 120
slippageBpsNo0-5000, default 50; never below the on-chain floor

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already declare readOnlyHint/idempotentHint/destructiveHint=false, so safety is covered structurally; the description adds real value by disclosing the execution mechanism (eth_call on your node, implying an RPC dependency) and the return contents ('the plan and the simulation'). It stops short of describing failure/revert behavior.

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

Conciseness5/5

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

Three short sentences, zero filler, with the core action front-loaded and the key non-mutating guarantee placed last for emphasis. Every sentence carries information.

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 read-only, 11-parameter tool with full schema coverage and no output schema, the description is nearly sufficient: it names the mechanism and says what is returned. It omits what a failed/reverting simulation looks like and any chain/version caveats that a caller might want.

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 description coverage is 100%, so the schema fully documents all 11 parameters including the amount/amountIn and slippage/deadline semantics. The description only loosely anchors the 'from' parameter ('from the given account') and adds no other parameter meaning, so the baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource (simulate/dry-run a swap) plus the exact mechanism (eth_call from the given account), which is more precise than the bare name. It implicitly relates to sibling build_swap by saying it 'builds the swap, then dry-runs it', but never names alternatives to route against explicitly.

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?

The phrase 'dry-run' and 'Nothing is signed or sent' imply the use case (preview before executing), so usage is inferable. However, it never states when to choose this over build_swap or get_quote, nor any preconditions or exclusions.

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