Skip to main content
Glama

Contract ABI, verified contract: ABI and source

contract_abi
Read-only

The verified ABI of a smart contract on Ethereum, Base, Arbitrum, Optimism or Polygon from Sourcify's open verification repository: contract name, compiler, match quality, every function and event signature, the full ABI, and for proxies the implementation contract with its ABI. Optional source=true adds the main source file (up to 20,000 characters). Unverified contracts are an uncharged 422. Use before calling or decoding a contract. Example: address=0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48. Price $0.01/call via x402 USDC or a card key (/credits), first 10 free; failed calls free. Reads or computes only and changes nothing; each call is charged, so repeats are not free.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "address": "<address>"
    },
    "name": "contract_abi"
  }
}

Input Schema

NameRequiredDescriptionDefault
chainNoethereum (default), base, arbitrum, optimism or polygon
sourceNotrue to include the main source file
addressYesContract 0x address

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.3/5.0
Behavior3/5

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

Beyond readOnlyHint=true, openWorldHint=true, idempotentHint=false and destructiveHint=false, the description discloses the 422 behavior for unverified contracts, the 20,000-character cap on source, proxy implementation inclusion, and the per-call charge with first 10 free, which explains why repeats are not idempotent. However, the framing 'Reads or computes only and changes nothing' largely restates the readOnly/destructive annotations rather than adding new behavioral context, so it sits at adequate rather than rich.

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?

Content is front-loaded: what is returned, the optional source flag, the unverified case, then usage and pricing. The pricing and free-tier clauses are compressed into a single trailing sentence, and every clause carries operational information an agent needs.

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 no output schema, the description enumerates the return payload (contract name, compiler, match quality, signatures, full ABI, proxy implementation) so the agent knows what to expect. It also covers the failure mode, cost model, and the only optional parameter's effect, leaving nothing material unclear for a three-parameter read tool.

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 the schema already defines address, chain default, and source. The description still adds meaning by quantifying what source=true returns — the main source file capped at 20,000 characters — and by showing a concrete address example in 0x form, which slightly exceeds the schema baseline of 3.

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+resource: retrieves the verified ABI (plus contract name, compiler, match quality, function/event signatures, and proxy implementation) from Sourcify across five named chains. This clearly separates it from existence-check siblings such as eth_is_contract or base_is_contract, since it returns the full interface rather than a boolean.

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 explicit timing guidance — 'Use before calling or decoding a contract' — which is the primary trigger condition, and notes that unverified contracts yield a 422. It does not explicitly name an alternative sibling to use instead when a contract is unverified, so the routing guidance is clear but not exhaustive.

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.

Resources