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).
Behavior4/5

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

Annotations already provide readOnlyHint, destructiveHint, etc. Description adds that result is base64-encoded, arguments must be base64-encoded, and specific encoding for addresses and numbers, which goes beyond annotations.

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?

The description is three sentences: purpose, return format, and encoding guidance. No fluff, front-loaded with key information, and each sentence adds value.

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 5 parameters (2 required), 100% schema coverage, and no output schema, the description covers the tool's behavior, encoding, and usage adequately. Could hint at decoding the result but not necessary.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 100% schema coverage, baseline is 3. Description adds value by explaining argument encoding in detail (hex-decoded bech32 for addresses, big-endian for numbers) and the purpose of the caller parameter, which is not in schema descriptions.

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 executes a read-only query against a smart contract, using specific verb 'query' and resource 'smart contract (VM view call)'. It distinguishes from siblings like invoke_sc by emphasizing 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?

Explicitly says 'Use this to read contract state without modifying it', which guides when to use. Does not name alternatives, but sibling list includes invoke_sc for write operations, making usage context clear.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/klever-io/mcp-klever-vm'

If you have feedback or need assistance with the MCP directory API, please join our Discord server