Skip to main content
Glama

contract_query

Run any CosmWasm smart query on a Terra Classic contract address and receive raw JSON results. Provide contract and query message to retrieve on-chain data directly.

Instructions

Generic CosmWasm contract query passthrough: run any {"smart":{...}} query against a terra1 contract and return raw JSON.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesquery msg, e.g. {"balance":{"address":"terra1..."}}
contractYesterra1... contract address

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 full burden and it does well by disclosing 'passthrough' behavior and 'raw JSON' output. 'Query' implies a read-only operation, and the smart-query envelope clarifies the expected request shape, though error or edge-case behavior is not mentioned.

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?

A single sentence conveys the action, target resource, input format, and output format without wasted words. It is fully front-loaded with the core purpose before the supporting detail.

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?

For a two-parameter passthrough tool with no output schema, the description covers the essential details: input query envelope, target address, and raw JSON output. It does not explain failure modes or access restrictions, but for a generic read-only query tool these are not critical.

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?

Schema coverage is 100%, so the baseline is 3, but the description adds a critical detail the schema example does not: the query must be wrapped in a '{"smart":...}' envelope. This directly helps an agent construct valid input beyond what the schema alone shows.

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 uses a specific verb ('run') and names the resource ('CosmWasm contract') plus the exact query envelope ('{"smart":{...}}'). 'Generic passthrough' also distinguishes it from more specialized sibling tools like balance or simulate_tx.

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 word 'generic' implies this is the fallback for arbitrary contract queries, but the description does not explicitly state when to prefer it over specialized siblings or when not to use it. Usage context is implied rather than directly stated.

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