Skip to main content
Glama

Call contract (read-only)

call_contract
Read-onlyIdempotent

Runs a read-only eth_call against a contract and decodes the result. Nothing is signed or sent: state changes are discarded. Give either raw "data" (0x-hex calldata), or "function" plus "args":

  • function is a name ("balanceOf") resolved against "abi" (a JSON ABI you pass) or, when abi is omitted, the contract's verified ABI from the explorer; or a full signature such as "balanceOf(address) returns (uint256)", which needs no ABI.

  • args is a JSON array: integers as decimal strings (or 0x-hex), addresses and bytes as 0x-hex, arrays as arrays, tuples as objects or arrays. Optional: from, value_wei, and block (number or hash, for historical state on an archive node). Returns the raw return data and, when an ABI is known, the decoded values. A revert returns its reason (untrusted) instead. Example: {"to": "0xd106…a214", "function": "balanceOf(address) returns (uint256)", "args": ["0x45a1…0248"]}.

Input Schema

NameRequiredDescriptionDefault
toYescontract address
abiNocontract ABI as a JSON string; when omitted the explorer's verified ABI is used
argsNofunction arguments as a JSON array; big integers as decimal strings
dataNoraw 0x-hex calldata; alternative to function+args
fromNosender address (optional)
blockNoblock number, hash or "latest" (default)
functionNofunction name resolved via abi or the verified ABI, or a full signature such as "balanceOf(address) returns (uint256)"
value_weiNoLAX to send with the call, in wei (decimal)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Adds real behavioral context beyond the already-rich annotations: nothing is signed or sent, state changes are discarded, and revert reasons are returned but flagged as untrusted. The trust caveat on revert text is exactly the kind of disclosure annotations cannot express.

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?

Purpose is front-loaded in the first sentence, then structured bullets and a concrete example. It is dense and long, but nearly every line conveys callable detail; the argument-encoding and ABI-resolution lines all earn their place.

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?

With 8 parameters, no output schema, and read-only annotations, the description still covers return values (raw return data plus decoded values when an ABI is known), the revert path, optional parameters, and a worked example. An agent has everything needed to invoke it correctly.

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 baseline is 3, but the description meaningfully extends it: argument encoding rules (integers as decimal strings or 0x-hex, addresses/bytes as 0x-hex, tuples as objects or arrays), full-signature handling that needs no ABI, and the block/archive-node nuance. It stops short of documenting from/value_wei behavior, keeping it below 5.

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 ('Runs a read-only eth_call against a contract and decodes the result') and immediately distinguishes the operation from state-mutating siblings. The scope ('state changes are discarded') makes it separable from estimate_gas, get_code, and get_storage_at without opening any schema.

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 conditional usage ('Give either raw data ... or function plus args') and explains ABI resolution fallbacks and when block matters (historical state on an archive node). It covers how to use the tool thoroughly but never explicitly routes against sibling tools, so it stops 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.