Skip to main content
Glama

detect_proxy

Read-onlyIdempotent

chainpeek: detect whether a contract is a proxy, and of which kind. For code size and hash use get_contract_code. Reads the code, seven storage slots, then one multicall. Returns is_contract, is_proxy, kind (eip1967_transparent | eip1967_uups | eip1967 | eip1967_beacon | eip1822_uups | oz_legacy | eip1167_minimal | erc7511_minimal | eip7702_delegation | eip2535_diamond, or the multisig-wallet kind when slot 0 and masterCopy() agree), implementation (and whether it has code; a clone adds immutable_args_bytes, a diamond facets), admin, beacon and the raw slots. The implementation can change after this read. A malformed or inconsistent node answer is a 5xx and is not charged. Typically 1-4 s. Price: USD 0.002. Free: 10 chain reads per IP per UTC day. Docs: https://tanod.dev/learn/proxy-contract-detection-api.html

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>",
      "address": "<address>"
    },
    "name": "detect_proxy"
  }
}

Input Schema

NameRequiredDescriptionDefault
chainYesChain to read.
addressYesContract address (0x + 40 hex).

Output Schema

NameRequiredDescriptionDefault
kindNo
adminNo
chainNo
errorNoOnly on an error result: an object {code, message}, or the reason string of an x402 PaymentRequired object.
slotsNo
beaconNo
facetsNo
addressNo
is_proxyNo
patternsNo
rpc_callsNo
code_bytesNo
is_contractNo
facets_totalNo
implementationNo
immutable_args_bytesNo
implementation_has_codeNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • addedOutput schema / properties / facets
      Added value: +{
      +  "type": [
      +    "array",
      +    "null"
      +  ]
      +}
    • addedOutput schema / properties / facets_total
      Added value: +{
      +  "type": [
      +    "integer",
      +    "null"
      +  ]
      +}
    • changedOutput schema / properties / kind / enum
      Previous value: -[
      -  "eip1967_transparent",
      -  "eip1967_uups",
      -  "eip1967",
      -  "eip1967_beacon",
      -  "eip1822_uups",
      -  "oz_legacy",
      -  "safe",
      -  "eip1167_minimal",
      -  "erc7511_minimal",
      -  "eip7702_delegation",
      -  null
      -]New value: +[
      +  "eip1967_transparent",
      +  "eip1967_uups",
      +  "eip1967",
      +  "eip1967_beacon",
      +  "eip1822_uups",
      +  "oz_legacy",
      +  "safe",
      +  "eip1167_minimal",
      +  "erc7511_minimal",
      +  "eip7702_delegation",
      +  "eip2535_diamond",
      +  null
      +]
  2. Changed1 schema field changed
    • addedOutput schema / properties / immutable_args_bytes
      Added value: +{
      +  "type": [
      +    "integer",
      +    "null"
      +  ]
      +}
  3. Changed4 schema fields changed
    • removedInput schema / properties / address / title
      Removed value: -"Address"
    • removedInput schema / properties / chain / title
      Removed value: -"Chain"
    • removedInput schema / title
      Removed value: -"detect_proxyArguments"
    • removedOutput schema / properties / patterns / items
      Removed value: -{
      -  "type": [
      -    "string",
      -    "null"
      -  ]
      -}
  4. Changed1 schema field changed
    • changedInput schema / properties / chain / enum
      Previous value: -[
      -  "ethereum",
      -  "base"
      -]New value: +[
      +  "ethereum",
      +  "base",
      +  "robinhood"
      +]
  5. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "address": {
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "admin": {
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "beacon": {
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "chain": {
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "code_bytes": {
      +      "type": [
      +        "integer",
      +        "null"
      +      ]
      +    },
      +    "error": {
      +      "description": "Only on an error result: an object {code, message}, or the reason string of an x402 PaymentRequired object."
      +    },
      +    "implementation": {
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "implementation_has_code": {
      +      "type": [
      +        "boolean",
      +        "null"
      +      ]
      +    },
      +    "is_contract": {
      +      "type": [
      +        "boolean",
      +        "null"
      +      ]
      +    },
      +    "is_proxy": {
      +      "type": [
      +        "boolean",
      +        "null"
      +      ]
      +    },
      +    "kind": {
      +      "enum": [
      +        "eip1967_transparent",
      +        "eip1967_uups",
      +        "eip1967",
      +        "eip1967_beacon",
      +        "eip1822_uups",
      +        "oz_legacy",
      +        "safe",
      +        "eip1167_minimal",
      +        "erc7511_minimal",
      +        "eip7702_delegation",
      +        null
      +      ],
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "patterns": {
      +      "items": {
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      },
      +      "type": [
      +        "array",
      +        "null"
      +      ]
      +    },
      +    "rpc_calls": {
      +      "type": [
      +        "integer",
      +        "null"
      +      ]
      +    },
      +    "slots": {
      +      "type": [
      +        "object",
      +        "null"
      +      ]
      +    }
      +  },
      +  "type": "object"
      +}
  6. Added

TDQS

A4/5.0
Behavior3/5

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

The annotations already declare readOnlyHint, idempotentHint, destructiveHint=false and openWorldHint, so the safety profile is covered. The description adds genuinely useful context beyond that: the read pattern (code + seven storage slots + one multicall), the staleness caveat that the implementation can change after the read, 5xx behavior on malformed node answers with no charge, latency, and pricing/free-quota limits. The return-field enumeration, however, largely duplicates the output schema rather than adding behavioral insight, so the added value is solid but partly redundant.

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 clause, and the operational details (latency, price, quota, docs link) are compact and each earn their place. The long enumerated list of proxy kinds and return fields is dense and partly redundant with the output schema, which slightly bloats an otherwise tight definition.

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?

For a paid, read-only chain tool, the description covers the read procedure, the meaning of a proxy result, staleness, error and billing behavior, latency, price, free tier, and documentation link. Combined with a full output schema and safety annotations, an agent has everything needed to call it correctly.

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% for both parameters, including the chain enum and the address pattern, so the schema does the heavy lifting. The description adds no syntax, format, or constraint details for chain or address beyond what is already structured, leaving this at the baseline.

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 opens with a specific verb and resource: 'detect whether a contract is a proxy, and of which kind.' It also names the sibling get_contract_code and states the boundary (code size and hash), so an agent can distinguish the two without opening either 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 explicitly routes code-size/hash requests to get_contract_code, giving one concrete alternative with its condition. It also gives practical context for choosing this tool (cost, free quota, latency), though it does not state when a proxy check is unnecessary or what to do after a positive result.

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