Skip to main content
Glama

read_contract

Read-onlyIdempotent

Calls read-only smart contract functions on TRON by contract address and function name, fetching the ABI from chain when needed.

Instructions

Call read-only functions on a smart contract.

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": {
      "contractAddress": "<contractAddress>",
      "functionName": "<functionName>"
    },
    "name": "read_contract"
  }
}

Input Schema

NameRequiredDescriptionDefault
abiNoOptional contract ABI array. If not provided, will fetch from chain. Use for contracts with incomplete on-chain ABI.
argsNoFunction arguments (supports arrays and objects for complex types)
networkNoNetwork name. Defaults to mainnet.
functionNameYesFunction name (e.g., 'name', 'symbol', 'balanceOf')
contractAddressYesThe contract address

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv1.1.9
    • removedInput schema / additionalProperties
      Removed value: -false
    • addedInput schema / properties / abi / items / propertyNames
      Added value: +{
      +  "type": "string"
      +}
    • changedInput schema / properties / args / items / anyOf
      Previous value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "number"
      -  },
      -  {
      -    "type": "boolean"
      -  },
      -  {
      -    "items": {
      -      "type": "string"
      -    },
      -    "type": "array"
      -  },
      -  {
      -    "items": {
      -      "type": "number"
      -    },
      -    "type": "array"
      -  },
      -  {
      -    "additionalProperties": {},
      -    "type": "object"
      -  }
      -]New value: +[
      +  {
      +    "type": "string"
      +  },
      +  {
      +    "type": "number"
      +  },
      +  {
      +    "type": "boolean"
      +  },
      +  {
      +    "items": {
      +      "type": "string"
      +    },
      +    "type": "array"
      +  },
      +  {
      +    "items": {
      +      "type": "number"
      +    },
      +    "type": "array"
      +  },
      +  {
      +    "additionalProperties": {},
      +    "propertyNames": {
      +      "type": "string"
      +    },
      +    "type": "object"
      +  }
      +]
  2. First observedv1.1.7

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, destructiveHint=false and openWorldHint, so the safety profile is fully covered and the description does not contradict it. However, the description adds essentially no behavior beyond that: nothing about on-chain ABI fetching when 'abi' is omitted, network fallback, failure modes, or the shape of the returned value.

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 short sentence with no filler and the key qualifier ('read-only') front-loaded. It is efficient, though its brevity comes at the cost of the missing detail noted elsewhere rather than through deliberate economy.

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

Completeness2/5

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

With five parameters, an open-world on-chain call, and no output schema, the description should at least hint at what a read call returns and how encoding of complex args or ABI fallback behaves. None of that is present, leaving the agent dependent entirely on the input schema.

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 every parameter (contractAddress, functionName, args, abi, network) is already documented in the schema, including the ABI-fetch fallback and network default. The description contributes no additional parameter meaning, which is the expected baseline 3 when the schema does the work.

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 gives a specific verb ('Call') and resource ('read-only functions on a smart contract'), which clearly separates it from the mutating sibling write_contract by implication. It stops short of naming that sibling explicitly, so an agent must infer the pairing rather than read it.

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 'read-only functions' implies the usage condition (view/pure calls, not state-changing ones), but there is no explicit when-to-use or when-not-to-use statement and no named alternative such as write_contract or get_contract_info. Guidance is inferable but not stated.

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