Skip to main content
Glama

Get code

get_code
Read-onlyIdempotent

The deployed bytecode of an address at the latest block or "block": whether it is a contract, the code size in bytes and its keccak256 hash. With include_code=true the bytecode itself is returned as hex (cut at 4096 bytes). An address with no code is an externally owned account (or a contract that self-destructed). For source code and ABI use explorer_contract.

Input Schema

NameRequiredDescriptionDefault
blockNoblock number, hash or "latest" (default)
addressYes0x-prefixed 20-byte address
include_codeNoalso return the bytecode as hex (cut at 4096 bytes)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already cover readOnly/idempotent/non-destructive, but the description adds genuinely useful behavior: the block defaults to 'latest', bytecode output is truncated at 4096 bytes, and an empty result indicates an EOA or self-destructed contract. These interpretive details go beyond the structured data.

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-loads the core purpose and stays dense without padding, with each sentence contributing (purpose, option behavior, empty-result interpretation, sibling routing). The mid-sentence colons and quoted '"block"' make the first sentence slightly clunky to parse.

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?

With no output schema, the description fully carries the return-value burden by explaining contract detection, size, hash, and the optional bytecode, plus how to interpret the empty case. Combined with annotations covering safety, nothing needed to call it correctly is 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?

Schema coverage is 100%, so the schema already documents address, block, and include_code. The description restates the include_code truncation and default block behavior but adds little syntax or format detail beyond what the schema provides, landing 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?

States a specific verb and resource (deployed bytecode of an address) and enumerates exactly what is returned: contract status, code size in bytes, keccak256 hash, and optionally the bytecode hex. It explicitly separates itself from the sibling explorer_contract, which covers source code and ABI.

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?

Provides a clear routing rule: 'For source code and ABI use explorer_contract,' which tells the agent when another tool is the right choice. However, it doesn't address other adjacent capabilities such as verifying a contract's balance or storage, so the exclusion set is not exhaustive.

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.