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"],
      },
    },

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