Skip to main content
Glama

cast_interface

Generate a Solidity interface from a contract address or ABI JSON file, using an RPC URL or Etherscan API key to fetch ABIs when needed.

Instructions

Generate a Solidity interface from a contract address or ABI file (cast interface).

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": {
      "addressOrPath": "<addressOrPath>"
    },
    "name": "cast_interface"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameNoName for the generated interface
rpcUrlNoRPC URL (required when using an address)
addressOrPathYesContract address or path to ABI JSON file
etherscanApiKeyNoEtherscan API key (for fetching ABI from explorer)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

C2.9/5.0
Behavior2/5

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

No annotations are supplied, so the description carries the full burden and does not meet it. It does not disclose whether the interface is printed to stdout or written to a file (the 'name' param hints at file output but never says so), nor that address-based use requires network/explorer access, nor whether generation is read-only and side-effect free.

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?

A single front-loaded sentence with no wasted clauses. The trailing parenthetical '(cast interface)' is close to redundant with the tool name but usefully anchors it to the underlying CLI command.

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?

With no output schema and no annotations, the description needs to cover the output side, and it does not: an agent cannot tell whether the generated interface is returned, printed, or persisted to a file. Given four documented params and modest complexity, it is minimally adequate but leaves a real behavioral gap.

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%, so all four parameters are already documented in the schema, including the conditional 'RPC URL (required when using an address)' dependency. The description adds nothing beyond restating the address-vs-file input choice, so the baseline 3 applies.

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 ('Generate') and resource ('Solidity interface') plus the two accepted input forms (contract address or ABI file). It is clearly distinct from siblings like cast_abi_encode or cast_code, but it never names or contrasts an alternative explicitly.

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, no prerequisite statement (e.g. that an address requires an RPC URL or Etherscan key to resolve the ABI), and no mention of when another tool would be preferred. The input alternatives are listed but not explained as a decision.

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