Skip to main content
Glama

read_contract

Call view or pure smart contract functions on Kaia to retrieve decoded, readable results without changing state. Provide contract address, function name, and ABI.

Instructions

Read a view/pure contract function (no state change). Requires contract address, function name, and ABI (JSON string or array). Use get_contract_abi first if you do not have the ABI. Returns decoded result as readable text.

Input Schema

NameRequiredDescriptionDefault
abiYesABI as JSON string or array. If missing, get_contract_abi can be called first to fetch it.
argsNoOptional array of arguments for the function (in order)
networkNomainnet or kairos (default: mainnet)
functionNameYesName of the function to call
contractAddressYesContract address (0x...)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations, the description carries the burden and does reasonably well: it declares the call is read-only ('no state change'), names the required inputs, and discloses the return format ('decoded result as readable text'). It omits error behavior and the effect of the network parameter, so it is not fully complete.

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?

Three sentences, front-loaded with the operation and its read-only nature, followed by requirements, the alternative tool, and the return shape. No filler and no repetition.

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?

Covers the essentials for a five-parameter read tool with no annotations and no output schema: it discloses the read-only semantics, the required inputs, and the decoded-text return. Only minor gaps remain, such as failure modes and network-specific behavior.

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 five parameters including args and network are already documented in the schema. The description restates the three required inputs and hints at the ABI's dual string/array form, but adds no syntax or format detail beyond what the schema provides. 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?

States a specific verb and resource ('Read a view/pure contract function') and immediately bounds it with 'no state change', which separates it from the write/encode siblings such as encode_function_data. An agent can identify the operation without opening the schema.

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?

Explicitly routes the agent to a prerequisite sibling: 'Use get_contract_abi first if you do not have the ABI.' That is clear context and an named alternative, but it does not state when not to use this tool (e.g. for state-changing calls).

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