Skip to main content
Glama

Simulate EVM Transaction

evm_simulate_transaction
Read-onlyIdempotent

Simulate read-only smart contract calls on any EVM network to test functions and get decoded results or revert reasons.

Instructions

Execute a read-only call against an EVM node using Foundry cast and return decoded results or revert reasons.

This tool does NOT submit a real transaction; it simulates via eth_call.

Args:

  • target (string): Target contract address (0x-prefixed, 42 chars)

  • signature (string): Function signature, e.g. "balanceOf(address)"

  • args (string, optional): Space-separated arguments for the function call

  • rpcUrl (string): JSON-RPC endpoint URL (e.g. http://localhost:8545)

Returns: { "success": boolean, "returnData": string, // Hex-encoded return data (on success) "revertReason": string, // Decoded revert string (on failure) "error": string // Raw error message (on execution failure) }

Examples:

  • "Check the balance of 0xabc..." → target=contract, signature="balanceOf(address)", args="0xabc..."

  • "Call the owner() function" → target=contract, signature="owner()", rpcUrl="http://localhost:8545"

Error Handling:

  • Returns { success: false, revertReason } if the call reverts

  • Returns { success: false, error } if cast is not installed or RPC is unreachable

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
argsNoSpace-separated arguments for the function call
rpcUrlYesJSON-RPC endpoint URL
targetYesTarget contract address (0x-prefixed, 42 chars)
signatureYesFunction signature, e.g. 'balanceOf(address)'

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
errorNo
successYes
returnDataNo
revertReasonNo
Behavior4/5

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

Annotations already provide readOnlyHint, idempotentHint, etc. Description adds behavioral details: uses Foundry cast, returns revert reasons and error handling. No contradiction.

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?

Well-structured with sections: brief purpose, arguments, returns, examples, error handling. Every sentence is informative, no fluff.

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?

Explains return format and error handling. Context signals indicate an output schema exists (though not shown), so description complements it well. Could be 5 if output schema were explicitly provided.

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 has 100% coverage, but description adds examples and format hints (e.g., target must be 0x-prefixed, args space-separated). This provides practical guidance beyond the schema.

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?

Clearly states it simulates a read-only call via eth_call, returns decoded results or revert reasons, and explicitly says it does NOT submit a real transaction. Differentiates from sibling tools like evm_trace_call by focusing on simulation.

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?

Provides clear context: simulates via eth_call, no real transaction. Includes examples for common use cases. Could be improved by explicitly stating when not to use (e.g., for write operations), but siblings are distinct enough.

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/0xendale/evm-agent-toolkit'

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