Skip to main content
Glama

Get Contract Abi

get_contract_abi
Read-onlyIdempotent

Get the verified ABI (JSON) for a contract address.

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_abi"
  }
}

Input Schema

NameRequiredDescriptionDefault
addressYesContract address.
chainidNoNumeric chain id (e.g. 1=Ethereum, 56=BNB, 137=Polygon). If omitted, defaults to Ethereum Mainnet (1).

Output Schema

NameRequiredDescriptionDefault
dataYesThe JSON result returned by the Etherscan data tool.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • changedInput schema / properties / chainid / description
      Previous value: -"Numeric chain id (e.g. 1=Ethereum, 56=BNB, 137=Polygon). Defaults to server config."New value: +"Numeric chain id (e.g. 1=Ethereum, 56=BNB, 137=Polygon). If omitted, defaults to Ethereum Mainnet (1)."
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "https://json-schema.org/draft/2020-12/schema",
      +  "additionalProperties": false,
      +  "properties": {
      +    "data": {
      +      "anyOf": [
      +        {
      +          "additionalProperties": {},
      +          "type": "object"
      +        },
      +        {
      +          "items": {},
      +          "type": "array"
      +        },
      +        {
      +          "type": "string"
      +        },
      +        {
      +          "type": "number"
      +        },
      +        {
      +          "type": "boolean"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "description": "The JSON result returned by the Etherscan data tool."
      +    }
      +  },
      +  "required": [
      +    "data"
      +  ],
      +  "type": "object"
      +}
  2. First observed

TDQS

B3.3/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint, openWorldHint, and destructiveHint=false, so the safety profile is fully covered. The word 'verified' adds a genuinely useful behavioral signal — the call only succeeds for contracts with a published ABI — but the description never states what happens for unverified contracts (error vs. empty).

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?

A single front-loaded sentence with zero filler; the essential resource and output format are stated immediately.

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?

An output schema exists, so return shape need not be described, and annotations cover safety. The remaining gap is the unverified-contract failure mode and the absence of any pointer to sibling tools for source or creation data — meaningful omissions for an agent choosing among 20+ contract-related tools.

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 description coverage is 100%, including the chainid default of Ethereum Mainnet, so the schema carries the parameter burden. The description adds nothing beyond restating the address parameter.

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 states a specific verb and resource ('Get the verified ABI (JSON) for a contract address'), which is clearly distinct from siblings like get_contract_source or get_contract_creation. It stops short of explicitly naming those alternatives, so the differentiation is left implicit.

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

Usage Guidelines2/5

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

There is no when-to-use guidance and no mention of alternatives such as get_contract_source for human-readable source. The agent must infer that this tool is for machine-readable interface definitions rather than source code.

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.

Resources