Skip to main content
Glama

Get Contract ABI

get_contract_abi
Read-only

Get smart contract ABI (Application Binary Interface). An ABI defines all functions, events, their parameters, and return types. The ABI is required to format function calls or interpret contract data.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
addressYesSmart contract address
chain_idYesThe ID of the blockchain
session_idNoOpaque session identifier.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataYesThe main data payload of the tool's response.
notesNoA list of important contextual notes, such as warnings about data truncation or data quality issues.
paginationNoPagination information, present only if the 'data' is a single page of a larger result set.
content_textNoOptional human-readable summary used for MCP content responses.
instructionsNoA list of suggested follow-up actions or instructions for the LLM to plan its next steps.
data_descriptionNoA list of notes explaining the structure, fields, or conventions of the 'data' payload.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / session_id
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Opaque session identifier.",
      +  "title": "Session Id"
      +}
  2. Changed6 schema fields changed
    • removedInput schema / $schema
      Removed value: -"http://json-schema.org/draft-07/schema#"
    • removedInput schema / additionalProperties
      Removed value: -false
    • addedInput schema / properties / address / title
      Added value: +"Address"
    • addedInput schema / properties / chain_id / title
      Added value: +"Chain Id"
    • addedInput schema / title
      Added value: +"get_contract_abiArguments"
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$defs": {
      +    "ContractAbiData": {
      +      "description": "A structured representation of a smart contract's ABI.",
      +      "properties": {
      +        "abi": {
      +          "anyOf": [
      +            {
      +              "items": {
      +                "additionalProperties": true,
      +                "type": "object"
      +              },
      +              "type": "array"
      +            },
      +            {
      +              "type": "null"
      +            }
      +          ],
      +          "description": "The Application Binary Interface (ABI) of the smart contract.",
      +          "title": "Abi"
      +        }
      +      },
      +      "required": [
      +        "abi"
      +      ],
      +      "title": "ContractAbiData",
      +      "type": "object"
      +    },
      +    "NextCallInfo": {
      +      "description": "A structured representation of the tool call required to get the next page.",
      +      "properties": {
      +        "params": {
      +          "additionalProperties": true,
      +          "description": "A complete dictionary of parameters for the next tool call, including the new cursor.",
      +          "title": "Params",
      +          "type": "object"
      +        },
      +        "tool_name": {
      +          "description": "The name of the tool to call for the next page.",
      +          "title": "Tool Name",
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "tool_name",
      +        "params"
      +      ],
      +      "title": "NextCallInfo",
      +      "type": "object"
      +    },
      +    "PaginationInfo": {
      +      "description": "Contains the structured information needed to retrieve the next page of results.",
      +      "properties": {
      +        "next_call": {
      +          "$ref": "#/$defs/NextCallInfo",
      +          "description": "The structured tool call required to fetch the subsequent page."
      +        }
      +      },
      +      "required": [
      +        "next_call"
      +      ],
      +      "title": "PaginationInfo",
      +      "type": "object"
      +    }
      +  },
      +  "properties": {
      +    "content_text": {
      +      "anyOf": [
      +        {
      +          "type": "string"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "default": null,
      +      "description": "Optional human-readable summary used for MCP content responses.",
      +      "title": "Content Text"
      +    },
      +    "data": {
      +      "$ref": "#/$defs/ContractAbiData",
      +      "description": "The main data payload of the tool's response."
      +    },
      +    "data_description": {
      +      "anyOf": [
      +        {
      +          "items": {
      +            "type": "string"
      +          },
      +          "type": "array"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "default": null,
      +      "description": "A list of notes explaining the structure, fields, or conventions of the 'data' payload.",
      +      "title": "Data Description"
      +    },
      +    "instructions": {
      +      "anyOf": [
      +        {
      +          "items": {
      +            "type": "string"
      +          },
      +          "type": "array"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "default": null,
      +      "description": "A list of suggested follow-up actions or instructions for the LLM to plan its next steps.",
      +      "title": "Instructions"
      +    },
      +    "notes": {
      +      "anyOf": [
      +        {
      +          "items": {
      +            "type": "string"
      +          },
      +          "type": "array"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "default": null,
      +      "description": "A list of important contextual notes, such as warnings about data truncation or data quality issues.",
      +      "title": "Notes"
      +    },
      +    "pagination": {
      +      "anyOf": [
      +        {
      +          "$ref": "#/$defs/PaginationInfo"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "default": null,
      +      "description": "Pagination information, present only if the 'data' is a single page of a larger result set."
      +    }
      +  },
      +  "required": [
      +    "data"
      +  ],
      +  "title": "ToolResponse[ContractAbiData]",
      +  "type": "object"
      +}
  3. Changed5 schema fields changed
    • addedInput schema / $schema
      Added value: +"http://json-schema.org/draft-07/schema#"
    • addedInput schema / additionalProperties
      Added value: +false
    • removedInput schema / properties / address / title
      Removed value: -"Address"
    • removedInput schema / properties / chain_id / title
      Removed value: -"Chain Id"
    • removedInput schema / title
      Removed value: -"get_contract_abiArguments"
  4. First observed

TDQS

A3.9/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, and the description does not contradict them. However, the description does not disclose additional behavioral traits such as availability for unverified contracts or potential errors, so it adds limited behavioral context beyond the annotations.

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. The first states the action, and the second explains the concept of an ABI and its purpose. Every sentence earns its place with no redundancy.

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 simple read-only getter with a complete schema, annotations, and an output schema, the description adequately covers the tool's purpose and context. It explains what an ABI is and why it's needed, making it complete for agent orientation.

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 covers 100% of parameters with descriptions (address, chain_id, session_id), so the baseline is 3. The description adds no additional parameter-level meaning beyond what the schema already provides.

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 clearly states the tool retrieves a smart contract ABI and explains what an ABI defines, giving a specific verb and resource. It does not explicitly distinguish from sibling tools like inspect_contract_code or read_contract, but the purpose is unambiguous.

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 indicates the ABI is required to format function calls or interpret contract data, implying when the tool is needed. It does not mention alternatives or exclusions, but the context is clear.

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.