Skip to main content
Glama

evm_validate_address

Validate Ethereum addresses for correct format and EIP-55 checksum, and detect whether an address is a contract or wallet on a specified EVM chain to prevent transaction errors.

Instructions

Validate Ethereum address format, checksum, and determine if it's a contract or EOA.

Performs comprehensive address validation including format checking, EIP-55 checksum verification, and on-chain contract detection. Essential for preventing transaction errors.

CRITICAL RULES:

  • Address MUST be 42 characters (0x + 40 hex digits)

  • Validates EIP-55 checksum if provided (mixed case)

  • Distinguishes between Externally Owned Accounts (EOA) and contracts

  • Returns validation status even for invalid addresses (doesn't throw)

PARAMETERS:

  • chain: EVM chain to check contract status (required)

    • Contract detection requires chain query

    • Same address may be EOA on one chain, contract on another

    • Validation format rules are universal across chains

  • address: Ethereum address to validate (required)

    • Format: 0x followed by 40 hexadecimal characters

    • Can be lowercase, uppercase, or mixed case (checksummed)

    • Examples: "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb" (checksummed)

EXAMPLES: ✅ Validate checksummed address: {chain: "ethereum", address: "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb"}

✅ Check if address is contract: {chain: "polygon", address: "0x1234567890123456789012345678901234567890"}

✅ Validate lowercase address: {chain: "bsc", address: "0xabcdefabcdefabcdefabcdefabcdefabcdefabcd"}

❌ Invalid - wrong length: {chain: "ethereum", address: "0x1234"}

❌ Invalid - missing 0x prefix: {chain: "polygon", address: "742d35Cc6634C0532925a3b844Bc9e7595f0bEb"}

SUPPORTED EVM CHAINS (7 networks): • ethereum (Sepolia) - EIP-1559 enabled, ~12s blocks, moderate gas costs • polygon (Amoy) - Low fees, fast finality (~2s), layer 2 • avalanche (Fuji C-Chain) - Sub-second finality, dynamic fees • bsc (BNB Testnet) - 3s blocks, low gas costs, Binance ecosystem • arbitrum (Sepolia) - Optimistic rollup, low fees, Ethereum security • base (Sepolia) - Coinbase layer 2, EIP-1559, low fees • worldchain (World Sepolia) - World Network testnet, EIP-1559

CRITICAL GAS CONSIDERATIONS:

  • Ethereum: High gas costs, use gas oracle for timing

  • Polygon/BSC: Very low gas, safe for frequent transactions

  • Arbitrum/Base: L2 optimizations, ~10-50x cheaper than Ethereum

  • Avalanche: Dynamic fees, can spike during congestion

  • Always check gas price before executing transactions

TESTNET TOKENS: All chains use testnet tokens with NO REAL VALUE. Faucets available for all supported networks.

OUTPUT STRUCTURE: • success: Boolean indicating operation success • valid: Boolean - is address format valid? • checksumValid: Boolean - does checksum match? (null if all lowercase/uppercase) • isContract: Boolean - is this a contract address? • address: Original input address • checksummedAddress: Properly checksummed version (EIP-55) • executionTime: Time taken in milliseconds

COMMON MISTAKES:

  • Not checking both "valid" and "isContract" fields

  • Assuming checksum validation failure means invalid address

  • Forgetting addresses can be contracts on some chains but not others

  • Not using checksummed addresses in user interfaces

USE CASES:

  • Validate user input before sending transactions

  • Distinguish between wallet addresses and contract addresses

  • Verify address checksums for security

  • Convert addresses to proper EIP-55 format

  • Prevent sending tokens to wrong address types

Running on Linux.

LINUX-SPECIFIC NOTES:

  • Package manager: apt (Ubuntu/Debian), yum (RHEL/CentOS), or pacman (Arch)

  • Python 3 is typically 'python3' command

  • GNU tools are standard

  • Use 'xdg-open' command to open files/applications

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

Input Schema

NameRequiredDescriptionDefault
chainYesEVM chain to query
addressYesEthereum address to validate (0x... - 42 characters)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.9/5.0
Behavior4/5

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

With no annotations supplied, the description carries the full burden and does reasonably well: it discloses that the tool returns validation status rather than throwing on invalid input, that contract detection requires an on-chain chain query, and that checksumValid is null for all-lowercase/uppercase input. It never explicitly says the operation is read-only or whether network access is required for format-only checks, which leaves a small gap.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness2/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The useful content is front-loaded, but the definition is heavily bloated: full per-chain gas economics, faucet/testnet notes, a generic 'CRITICAL GAS CONSIDERATIONS' section irrelevant to address validation, and an entirely off-topic 'Running on Linux / LINUX-SPECIFIC NOTES' block about apt and xdg-open. A large fraction of the text does not earn its place.

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 two-parameter tool with no annotations and no output schema, the description supplies an explicit OUTPUT STRUCTURE field-by-field (valid, checksumValid, isContract, checksummedAddress, executionTime), invalid-input examples, and a COMMON MISTAKES section. Nothing an agent needs in order to call it and interpret results is missing.

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 the baseline is 3; the description earns above that by adding real meaning the schema lacks — that chain matters because the same address can be an EOA on one chain and a contract on another, while format rules are chain-universal, plus case-insensitivity and concrete example values. The chain list section, however, is padded with gas and testnet commentary irrelevant to the parameters.

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 opening sentence states a specific verb and resource ('Validate Ethereum address format, checksum, and determine if it's a contract or EOA'), which is precise enough that an agent can distinguish it from siblings like evm_lookup_address or evm_generate_address. It never explicitly names an alternative, so it stops short of a 5.

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?

The USE CASES block gives concrete when-to-use conditions (validating user input before transactions, distinguishing wallet vs contract addresses, converting to EIP-55). It does not state when NOT to use it or point to a sibling such as evm_lookup_address for retrieval, so no exclusions are covered.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools