Skip to main content
Glama

Get contract code / check if contract

avax_get_code
Read-onlyIdempotent

Check if an Ethereum address is a contract and retrieve its bytecode size and prefix to verify deployments on Avalanche networks.

Instructions

Return whether an address is a contract and its bytecode size (and bytecode prefix). Use to verify deployments.

Network: "mainnet" (C-Chain), "fuji" (testnet C-Chain), a known L1 key (mainnet, c-chain, fuji, dexalot, beam, dfk, dispatch-fuji, echo-fuji), or a full RPC URL.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
addressYes0x-prefixed 20-byte EVM address
networkNoNetwork: "mainnet" (C-Chain), "fuji" (testnet C-Chain), a known L1 key (mainnet, c-chain, fuji, dexalot, beam, dfk, dispatch-fuji, echo-fuji), or a full RPC URL.fuji
Behavior4/5

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

Annotations already declare this as read-only, idempotent, and non-destructive, so the description doesn't need to repeat that. It adds value by specifying exactly what the tool returns (a boolean indicator, bytecode size, and bytecode prefix) and by detailing the network options. This goes beyond the bare annotations and clarifies the tool's observable behavior.

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

Conciseness5/5

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

The description is two concise sentences, with the primary purpose and output front-loaded in the first sentence and network details in the second. Every word contributes—no filler or redundancy. This is an excellent example of compact, high-signal writing.

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?

For a read-only tool with only two parameters and no output schema, the description covers the essential context: what it does, when to use it, and the valid network selection. It does not describe the exact return format (e.g., JSON structure) but the textual description of returning 'whether an address is a contract, bytecode size, prefix' gives the agent enough to understand the result. No critical detail seems missing.

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?

The input schema has 100% coverage of both parameters, including descriptions for address ('0x-prefixed 20-byte EVM address') and network (listing all valid network keys). The description adds little new information about parameters—it essentially reiterates the network options and adds the 'verify deployments' context, but does not elabare on parameter formats or edge cases. Baseline 3 is appropriate since the schema handles parameter documentation.

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 clearly states what the tool does: 'Return whether an address is a contract and its bytecode size (and bytecode prefix).' This is a specific verb ('Return') and resource ('address contract code'), and the title reinforces the purpose. It distinguishes itself from siblings like avax_get_balance or avax_call_contract by focusing on code presence and size.

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 description provides a clear use case: 'Use to verify deployments.' This gives the agent a concrete scenario for when to invoke this tool. It does not explicitly name alternatives or state when *not* to use it, but the narrow scope (contract code vs. balance/transactions) makes the intended usage reasonably unambiguous.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Eelvanpsd/Avalanche-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server