Skip to main content
Glama

hcs_query

Query Hedera Consensus Service topics using natural language questions to retrieve AI-ranked relevant messages with plain English summaries.

Instructions

Query an HCS topic with a natural language question. Returns AI-ranked relevant messages and a plain English summary. Costs 0.05 HBAR.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
api_keyYesYour HederaIntel API key
queryYesNatural language question about the topic
topic_idNoHedera topic ID (e.g. 0.0.8026796). Defaults to the HederaIntel platform topic.
limitNoMax messages to retrieve (default 50)

Implementation Reference

  • The handler function for "hcs_query" that processes the tool logic, including payment charging, message retrieval, and analysis.
    if (name === "hcs_query") {
      const payment = chargeForTool("hcs_query", args.api_key);
      const topicId = args.topic_id || PLATFORM_TOPIC;
      const messages = await getTopicMessages(topicId, args.limit || 50);
      const analysis = await analyzeMessages(messages, args.query);
      return {
        topic_id: topicId,
        query: args.query,
        messages_retrieved: messages.length,
        messages_relevant: analysis.relevant_messages?.length || 0,
        summary: analysis.summary,
        anomalies: analysis.anomalies,
        recommended_action: analysis.recommended_action,
        relevant_messages: analysis.relevant_messages || [],
        payment,
        timestamp: new Date().toISOString(),
      };
    }
  • The input schema definition for "hcs_query", including properties like topic_id, query, limit, and api_key.
    {
      name: "hcs_query",
      description: "Query an HCS topic with a natural language question. Returns AI-ranked relevant messages and a plain English summary. Costs 0.1 HBAR.",
      inputSchema: {
        type: "object",
        properties: {
          topic_id: { type: "string", description: "Hedera topic ID (e.g. 0.0.8026796). Defaults to the HederaIntel platform topic." },
          query: { type: "string", description: "Natural language question about the topic" },
          limit: { type: "number", description: "Max messages to retrieve (default 50)" },
          api_key: { type: "string", description: "Your HederaIntel API key" },
        },
        required: ["query", "api_key"],
      },
    },
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It discloses key behavioral traits: it returns AI-ranked messages and a summary, and mentions a cost (0.05 HBAR), which is valuable context. However, it lacks details on rate limits, error handling, or authentication needs beyond the api_key parameter.

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 front-loaded and concise, with two sentences that efficiently convey purpose, output, and cost without any wasted words. Every sentence adds value, making it easy to understand quickly.

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

Completeness3/5

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

Given no annotations and no output schema, the description provides basic completeness by stating what the tool does and its cost. However, for a tool with 4 parameters and no output schema, it could benefit from more details on return format or error cases, leaving some gaps in context.

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 the schema already documents all parameters thoroughly. The description adds minimal value beyond the schema, mentioning 'natural language question' which aligns with the query parameter but doesn't provide additional semantics. Baseline 3 is appropriate as the schema does the heavy lifting.

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 purpose with specific verbs ('query', 'returns') and resources ('HCS topic'), distinguishing it from siblings like hcs_monitor or hcs_audit_trail by focusing on natural language queries with AI-ranked results and summaries. It explicitly mentions what it does and what it returns.

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?

The description implies usage context by specifying it's for querying HCS topics with natural language questions, but it does not explicitly state when to use this tool versus alternatives like hcs_understand or hcs_monitor. It provides some guidance through the cost mention, but lacks explicit when-not or alternative recommendations.

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/mountainmystic/hederatoolbox'

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