Skip to main content
Glama
klever-io
by klever-io

query_sc

Read-onlyIdempotent

Execute read-only queries against Klever smart contracts via view calls. Returns base64-encoded contract function results without modifying state.

Instructions

Execute a read-only query against a Klever smart contract (VM view call). Returns the contract function result as base64-encoded return data. Arguments must be base64-encoded. Use this to read contract state without modifying it.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
scAddressYesSmart contract address (klv1... bech32 format).
funcNameYesFunction name to call (must be a #[view] function on the contract).
argsNoOptional base64-encoded arguments. For addresses, encode the hex-decoded bech32 bytes. For numbers, use big-endian byte encoding.
callerNoOptional caller address (klv1... bech32 format). Some view functions use the caller to look up address-keyed storage mappers.
networkNoNetwork to query. Options: "mainnet", "testnet", "devnet", "local". Defaults to server default (mainnet).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.3.0

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare read-only, idempotent, and non-destructive behavior. The description adds valuable context: it returns base64-encoded data, requires base64-encoded arguments, and explicitly confirms state is not modified. It goes beyond what annotations provide without contradicting them.

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 focused sentences, front-loaded with the primary action. Every sentence adds value: what it does, return format, argument encoding, and usage intent. No redundancy or fluff.

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?

The description adequately covers the tool's purpose, input requirements (base64), and return type (base64-encoded return data). Given the rich schema and annotations, it provides sufficient context for an agent to invoke it correctly, though it could mention decoding the response or error handling.

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 coverage is 100% with detailed parameter descriptions. The description reinforces the base64 requirement but adds no new information beyond the schema. Since schema already explains encoding details for addresses and numbers, the description's contribution is minimal.

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?

The description clearly states the tool's function: executing a read-only query against a Klever smart contract via a VM view call. It distinguishes this from sibling tools like get_account or get_balance by specifying the resource (smart contract) and the read-only nature.

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?

Provides clear usage context: 'Use this to read contract state without modifying it.' This implies when to use it, though it doesn't explicitly mention alternatives or exclusions. The read-only hint and view call language effectively guide selection.

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