Skip to main content
Glama

EVM code

evm_code
Read-onlyIdempotent

Use when you need to know whether an address is a contract on Base, Ethereum, Arbitrum, Polygon or Optimism: is_contract, bytecode size, sha256 of the bytecode. Returns the paid x402 request for your input (GET /evm/code, $0.002 per call; schema linked). Call that URL with an x402 or MPP client to get the data. Bad input is refused before any charge. Contract check with bytecode size and hash only; for the coin balance use evm_native_balance, for the transaction count use evm_nonce. First call each day returns the data itself, free; later calls return the paid request.

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": "evm_code"
  }
}

Input Schema

NameRequiredDescriptionDefault
chainNoChain; default basebase
addressYesAddress to test for contract code (0x + 40 hex); a plain account returns is_contract=false

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / address / description
      Previous value: -"0x address (40 hex)"New value: +"Address to test for contract code (0x + 40 hex); a plain account returns is_contract=false"
  2. Added

TDQS

A4.5/5.0
Behavior5/5

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

Annotations only say read-only/idempotent/open-world; the description adds the operationally critical behavior: the tool returns a paid x402 request (GET /evm/code, $0.002 per call) rather than the data, the first call each day is free, bad input is rejected before charging, and the caller must use an x402 or MPP client. That is substantial context an agent could not infer from the 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?

Front-loaded with the use case, then payment mechanics, then sibling comparisons — a sensible priority order. It is somewhat dense and repeats the 'contract check with bytecode size and hash' idea already stated in the opening sentence, so it is not perfectly tight.

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 carries the burden of explaining return values, and it does name the three fields plus the payment/retrieval flow. Minor gaps remain on exact response shape and bytecode size units, but an agent has everything needed to call it and interpret the result.

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%, with enum, pattern and default already documented, so the baseline is 3. The description mentions the supported chains and notes that a plain account yields is_contract=false, but adds no format, casing, or defaulting detail 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?

States a specific verb and resource — determine whether an address is a contract on Base/Ethereum/Arbitrum/Polygon/Optimism — and enumerates the returned fields (is_contract, bytecode size, sha256). It also explicitly contrasts with siblings evm_native_balance and evm_nonce, so the agent can distinguish it 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 Guidelines5/5

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

Opens with an explicit 'Use when you need to know whether an address is a contract' trigger, then names the alternatives for the adjacent questions (coin balance → evm_native_balance, transaction count → evm_nonce). Both the selection condition and the exclusions are spelled out.

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