Skip to main content
Glama

Base contract inspection: code size, proxy implementation, ERC-20/721/1155 detection

chain_contract
Read-only

Inspects one Base mainnet address: whether it holds contract code and how large, whether it is an EIP-1967 upgradeable proxy (and its implementation address), EIP-7702 delegation, and which standards it reports or behaves like (ERC-165, ERC-721 NFT, ERC-1155, ERC-20). Useful for knowing what kind of contract an agent is about to interact with or approve. Read-only. Not charged for an invalid address or when Base can't be reached. Paid via x402; see list_prices.

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

Input Schema

NameRequiredDescriptionDefault
addressYes0x address on Base.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.3/5.0
Behavior4/5

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

Goes well beyond the annotations: it discloses read-only nature, that invalid addresses or Base unreachability are not charged, and that the call is paid via x402 with pricing available through list_prices. That billing/quota context is exactly the kind of behavioral detail annotations cannot convey. It stops short of describing response shape or latency, so not a 5.

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 resource and the enumerated checks, then tacked on the operational notes (read-only, no charge on failure, x402). Dense but every clause carries information; the only minor cost is that the first sentence is quite long.

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 takes on the job of saying what comes back, and it does so by enumerating the inspection results (code size, implementation address, delegation, detected standards). Chain scoping, read-only behavior, and billing are all covered. Missing only error/edge-case return details beyond the no-charge note.

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?

Single required parameter with 100% schema description coverage ("0x address on Base"), so the schema already carries the semantics and the baseline is 4. The description reinforces that the scope is Base mainnet only, which is useful disambiguation for an address parameter.

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 (inspects) and resource (one Base mainnet address) and enumerates exactly what is returned: code presence/size, EIP-1967 proxy + implementation, EIP-7702 delegation, and standard detection. This clearly separates it from chain_balance, chain_token, and chain_tx, which deal with balances, token metadata, and transactions rather than contract introspection.

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?

"Useful for knowing what kind of contract an agent is about to interact with or approve" gives a concrete when-to-use context. It does not explicitly name a sibling alternative or state exclusions, but the use case is specific enough to route the agent correctly.

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