Skip to main content
Glama

chain_bytecode_compare

Read-only

Contract bytecode compare (clone, fork and proxy-aware, 5 EVM chains) — Compare the deployed runtime bytecode of two contracts on the same or different chains (ethereum, base, arbitrum, optimism, polygon). Verdict IDENTICAL / SAME_CODE_DIFFERENT_METADATA / SAME_LOGIC_DIFFERENT_CONSTANTS / NEAR_IDENTICAL / SIMILAR / DIFFERENT with an opcode similarity score, code hashes, compiler metadata (solc version, ipfs/bzzr hash kind) and function-selector overlap. Follows EIP-1167, EIP-1967 and ZeppelinOS proxies (e.g. Circle FiatTokenProxy) and compares the implementation code that actually runs. Use it to spot clones and forks, confirm a bridged token runs the canonical code, or check what an upgrade changed. a= and b= required; chain= (default ethereum) and chain_b= for a cross-chain compare. 422 if either address has no code. Price: $0.003 USDC (Base, via x402).

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": {
      "chain": "<chain>",
      "a": "<a>",
      "b": "<b>"
    },
    "name": "chain_bytecode_compare"
  }
}

Input Schema

NameRequiredDescriptionDefault
aYes0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48
bYes0x1aBaEA1f7C830bD89Acc67eC4af516284b1bC33c
chainYesethereum

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, and the description goes well beyond them: it discloses EIP-1167/EIP-1967/ZeppelinOS proxy traversal so the compared bytes are the implementation, the 422 behavior when an address has no code, and a per-call price of $0.003 USDC via x402. Cost and failure semantics are exactly the kind of context annotations cannot carry.

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 most decision-relevant facts (what it compares, proxy awareness, required inputs) are front-loaded, and the verdict list is compact rather than prose-expanded. The opening clause largely restates the annotation title, and the parameter notes are crammed into one trailing sentence, which costs some scannability.

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?

With no output schema, the description compensates well by enumerating the return payload (verdict, opcode similarity score, code hashes, solc version and metadata hash kind, function-selector overlap). What it omits is a coherent account of the cross-chain path — chain_b is undocumented in the schema and its relationship to chain is never clarified.

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 coverage is 100%, so baseline is 3, and the description does add the default chain value (ethereum) and the required a=/b= pairing. However it introduces 'chain_b=' for cross-chain compares, which does not exist in the supplied schema, and says chain 'defaults to ethereum' although chain is listed as required — both risks for an agent constructing a call.

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 leads with a concrete verb and resource — 'Compare the deployed runtime bytecode of two contracts' — and scopes it to five named chains with explicit proxy handling. The enumerated verdict taxonomy (IDENTICAL / SAME_CODE_DIFFERENT_METADATA / ... / DIFFERENT) makes the output shape unmistakable, so an agent can tell this apart from generic reads like chain_code or chain_contract_info without opening a 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?

It names three concrete use cases: spotting clones and forks, confirming a bridged token runs canonical code, and checking what an upgrade changed. That is clear positive guidance, but there are no exclusions or explicit pointers to sibling alternatives (e.g. when to use chain_code for a single contract instead).

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