Skip to main content
Glama

simulate_transaction

Read-onlyIdempotent

Simulate a transaction on any supported chain using eth_call to preview its outcome. Verify contract calls succeed or catch revert reasons before signing, even for state-dependent operations.

Instructions

Run an eth_call against the chain's RPC to simulate a transaction without signing or broadcasting it. Returns { ok, returnData?, revertReason? }. Use this BEFORE prepare_*/send_transaction to verify a contract call does what you expect — e.g. does wrapping ETH by sending to WETH9's fallback succeed, does a custom calldata revert, what selector gets hit. For state-dependent calls (WETH deposit credits msg.sender, ERC-20 transfer debits msg.sender), pass the user's wallet as from. Prepared transactions are also re-simulated automatically at send_transaction time — this tool lets the agent check ahead. NEVER call this on a tx that depends on an approval you just submitted but haven't yet waited on: the approval must be included on-chain (poll get_transaction_status until confirmed) before the dependent tx will simulate correctly — otherwise you get a misleading 'insufficient allowance' revert.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
chainNoethereum
fromNomsg.sender to simulate from. Omit for a state-independent call; include the user's wallet when the target contract's behavior depends on the caller (e.g. WETH9.deposit credits msg.sender, ERC-20 transfer debits msg.sender).
toYes
dataNoHex-encoded calldata. Omit for a plain value transfer.
valueNoValue to send with the call, in wei as a decimal string. Omit for 0. Example: "500000000000000000" for 0.5 ETH.
Behavior5/5

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

Annotations already declare readOnlyHint=true, providing a safety profile. The description adds further behavioral context: it's an eth_call, return data structure, state-dependence requiring `from`, and automatic re-simulation at send_transaction. No contradictions with annotations.

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?

The description is a single paragraph but well-organized: purpose, return format, usage guidelines, examples, and warnings. It is efficient but could benefit from bullet points for improved readability.

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?

The description covers purpose, return format, prerequisites, state-dependence, pitfalls (unconfirmed approvals), and re-simulation behavior. Paired with clear annotations, it provides a complete picture for correct tool invocation.

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 60%, but the description adds meaningful context for parameters like `from` (state-dependence) and `value` (example). While the schema covers basic descriptions, the description reinforces and extends understanding.

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 clearly states the tool simulates a transaction via eth_call without signing or broadcasting. It provides the return format and distinguishes itself from sibling tools like prepare_* and send_transaction by explicitly stating when to use it.

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

Usage Guidelines5/5

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

The description gives explicit when-to-use instructions (before prepare_*/send_transaction), when-not-to-use (after unconfirmed approvals), and provides examples (WETH wrapping, custom calldata). It also explains when to include the `from` parameter, offering comprehensive guidance.

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/szhygulin/vaultpilot-mcp'

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