Skip to main content
Glama

scan_contract_selectors

Read-onlyIdempotent

Stage 1 Free ($0.00) deterministic EVM bytecode inspector that extracts 4-byte function selectors and flags privileged backdoors (transferOwnership, upgradeTo, mint, selfdestruct). Queries live RPC for chain_id (8453 Base, 84532 Base Sepolia, 42161 Arbitrum) unless bytecode_override (0x hex) is supplied for offline analysis; falls back to empty bytecode on RPC error. Returns JSON with is_contract, bytecode_size_bytes, selectors_found, high_risk_selectors, risk_level (HIGH, LOW, EOA), and recommendation.

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": {
      "target_address": "<target_address>"
    },
    "name": "scan_contract_selectors"
  }
}

Input Schema

NameRequiredDescriptionDefault
chain_idNoEVM Chain ID (8453 for Base Mainnet, 84532 for Base Sepolia, 42161 for Arbitrum One)
target_addressYesHex EVM address of smart contract to inspect (e.g. '0x4200000000000000000000000000000000000006')
bytecode_overrideNoOptional raw contract runtime bytecode hex string (0x...) for offline analysis without RPC calls

Output Schema

NameRequiredDescriptionDefault
toolNo
stageNo
chain_idNo
cost_usdNo
risk_levelYes
is_contractYes
llm_invokedNo
recommendationNo
target_addressYes
selectors_foundYes
bytecode_size_bytesNo
high_risk_selectorsYes
high_risk_signaturesNo
upsell_recommendationNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changed
    • changedOutput schema / properties / high_risk_selectors / items / type
      Previous value: -"object"New value: +"string"
    • addedOutput schema / properties / high_risk_signatures
      Added value: +{
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
    • addedOutput schema / properties / llm_invoked
      Added value: +{
      +  "type": "boolean"
      +}
    • changedOutput schema / properties / selectors_found / items / type
      Previous value: -"string"New value: +"object"
    • addedOutput schema / properties / upsell_recommendation
      Added value: +{
      +  "type": [
      +    "string",
      +    "null"
      +  ]
      +}
  2. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "bytecode_size_bytes": {
      +      "type": "integer"
      +    },
      +    "chain_id": {
      +      "type": "integer"
      +    },
      +    "cost_usd": {
      +      "type": "number"
      +    },
      +    "high_risk_selectors": {
      +      "items": {
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "is_contract": {
      +      "type": "boolean"
      +    },
      +    "recommendation": {
      +      "type": "string"
      +    },
      +    "risk_level": {
      +      "enum": [
      +        "HIGH",
      +        "LOW",
      +        "EOA"
      +      ],
      +      "type": "string"
      +    },
      +    "selectors_found": {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "stage": {
      +      "type": "integer"
      +    },
      +    "target_address": {
      +      "type": "string"
      +    },
      +    "tool": {
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "target_address",
      +    "is_contract",
      +    "selectors_found",
      +    "high_risk_selectors",
      +    "risk_level"
      +  ],
      +  "type": "object"
      +}
  3. First observed

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already cover the read-only, idempotent, non-destructive and open-world profile, so the description's job is to add operational context — which it does by disclosing that it queries live RPC, which chains it supports, and that it falls back to empty bytecode on RPC error (an important caveat an agent must know to interpret results). It stops short of rate limits, auth requirements, or how partial/RPC-failure results should be treated downstream.

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?

One dense, front-loaded sentence followed by a return-summary sentence; the core purpose comes first and the conditional RPC/override logic follows. It is information-dense rather than padded, though the enumerated return fields partly duplicate the output schema and could be trimmed.

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 three-parameter, read-only inspection tool, the definition covers purpose, network context, offline mode, failure behavior, and risk-level semantics — enough for an agent to call it and interpret the outcome correctly. Return details are backed by an output schema, so the brief list is supplementary rather than load-bearing.

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 baseline is 3, but the description adds genuine meaning beyond the schema: bytecode_override is described as taking precedence over live RPC queries and enabling offline analysis, which is an inter-parameter relationship the schema does not spell out. The chain_id list is duplicated from the schema and adds little.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a precise verb+resource: 'deterministic EVM bytecode inspector that extracts 4-byte function selectors and flags privileged backdoors', and names the specific selectors it looks for. The 'Stage 1 Free' framing implicitly positions it as the cheap pre-check before a deeper audit, but no sibling is named explicitly, so the differentiation is inferential rather than stated.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

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

Usage context is implied rather than prescribed: live RPC is used unless bytecode_override is supplied for offline analysis, and supported chains are listed. There is no explicit when-to-use-this-vs-alternative guidance (e.g. versus deep_semantic_audit), and no stated exclusions or prerequisites.

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.