Skip to main content
Glama
Ethereum MCP
by ETHCF

get_contract_source

Fetch verified source code and metadata for a contract address, including compiler version, optimization settings, and full source to support auditing or integration.

Instructions

Get verified source code and metadata for a contract. Returns compiler version, optimization settings, and full source.

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

Input Schema

NameRequiredDescriptionDefault
addressYesContract address (0x...)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.0.0

TDQS

A3.5/5.0
Behavior3/5

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

With no annotations, the description carries the full disclosure burden. It does convey the response shape (compiler version, optimization settings, source), which is valuable, but it omits what happens for unverified contracts, whether the call is a pure read, and any rate limit or size considerations.

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?

Two short sentences, front-loaded with the purpose and followed by the returned fields. Every clause earns its place with no filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple one-parameter read tool with no output schema and no annotations, the description is mostly sufficient but leaves key gaps: behavior on unverified contracts and confirmation of read-only semantics. These are the details the structured fields cannot supply.

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?

There is a single required parameter with 100% schema description coverage ('Contract address (0x...)'), so the schema already covers semantics. The description adds nothing about the address format or chain scoping, making the baseline 3 appropriate.

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?

States a specific verb and resource (get verified source code and metadata for a contract) and lists concrete payload fields (compiler version, optimization settings, full source). It does not explicitly differentiate from the sibling get_contract_abi, so an agent must infer that this returns source rather than the ABI.

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 is only implied by the word 'verified' and by the resource name; there is no explicit statement of when to prefer this over get_contract_abi or get_coin_by_contract, and no mention of preconditions. An agent can guess the context, but the definition does not route it.

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