Skip to main content
Glama
stellar-mcp

stellar-mcp

by ijele-don

fetch_contract_spec

Fetch and decode a deployed Soroban contract's ABI/spec from its WASM, including functions, structs, enums, unions, and contract error codes for integration and debugging.

Instructions

Fetch and decode the ABI/spec (functions, structs, enums, unions, #[contracterror] codes) directly from a deployed Soroban contract WASM.

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": {
      "contract_id": "<contract_id>"
    },
    "name": "fetch_contract_spec"
  }
}

Input Schema

NameRequiredDescriptionDefault
networkNoOptional network override (defaults to configured STELLAR_NETWORK).
contract_idYesSoroban contract ID (C...)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.5/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full behavioral burden. It usefully discloses the shape of what comes back (functions, structs, enums, unions, error codes) and the data source (the deployed WASM), but says nothing about required network access, whether a contract must be deployed or verified, how errors are reported for an unknown contract_id, or whether results are cached. For a network-dependent lookup tool with zero annotation coverage this leaves meaningful gaps.

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 well-formed sentence that front-loads the verb and resource and then qualifies the contents. The parenthetical list is dense but earns its place by defining the scope; nothing is padding.

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

Completeness4/5

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

Given there is no output schema, the description compensates well by enumerating the decoded artifacts returned. It is weaker on operational context, such as failure behavior and network dependence, which matters for a tool that reaches out to a live chain.

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%, with contract_id documented as a Soroban contract ID (C...) and network documented with its default behavior and enum values. The description adds no parameter-level detail beyond naming the contract WASM as the source, so the baseline 3 applies.

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?

Uses a specific verb pair (fetch and decode) on a specific resource (ABI/spec of a deployed Soroban contract WASM), and enumerates exactly what the spec contains: functions, structs, enums, unions, and #[contracterror] codes. That enumeration distinguishes it from the XDR-oriented siblings (decode_xdr, inspect_xdr), which surface raw encoded data rather than a typed contract interface.

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?

The phrase 'directly from a deployed Soroban contract WASM' implies the situation in which this applies, i.e. when you need a contract's interface rather than its transactions or storage. However, it never states when to prefer this over decode_xdr or inspect_xdr, and gives no prerequisites or exclusions.

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