Skip to main content
Glama

hcs_audit_trail

Retrieve chronological audit trails for Hedera blockchain entities to track transaction history and verify activity records.

Instructions

Retrieve the full chronological audit trail for an entity from the Hedera blockchain. Costs 1 HBAR.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
api_keyYesYour HederaIntel API key
entity_idYesEntity ID to retrieve audit trail for
topic_idNoHCS topic ID to query. Defaults to the HederaIntel platform topic.
limitNoMax records to retrieve (default 50)

Implementation Reference

  • The handler implementation for the hcs_audit_trail tool. It fetches messages from the Hedera mirror node, filters them by entity_id, and returns a chronological audit trail.
    if (name === "hcs_audit_trail") {
      const payment = chargeForTool("hcs_audit_trail", args.api_key);
      const base = getMirrorNodeBase();
      const topicId = args.topic_id || PLATFORM_TOPIC;
      const limit = args.limit || 50;
    
      const response = await axios.get(
        `${base}/api/v1/topics/${topicId}/messages?limit=100&order=asc`
      );
    
      const messages = response.data.messages || [];
      const trail = [];
    
      for (const msg of messages) {
        try {
          const content = Buffer.from(msg.message, "base64").toString("utf-8");
          const record = JSON.parse(content);
          if (record.entity_id === args.entity_id) {
            trail.push({
              record_id: record.record_id,
              record_type: record.record_type,
              written_at: record.written_at,
              consensus_timestamp: msg.consensus_timestamp,
              sequence_number: msg.sequence_number,
              data: record.data,
            });
          }
        } catch (e) {
          continue;
        }
      }
    
      return {
        entity_id: args.entity_id,
        topic_id: topicId,
        total_records: trail.length,
        audit_trail: trail.slice(0, limit),
        payment,
        timestamp: new Date().toISOString(),
      };
    }
  • Definition and input schema for the hcs_audit_trail tool.
      name: "hcs_audit_trail",
      description: "Retrieve the full chronological audit trail for an entity from the Hedera blockchain. Costs 2.0 HBAR.",
      inputSchema: {
        type: "object",
        properties: {
          topic_id: { type: "string", description: "HCS topic ID to query. Defaults to the HederaIntel platform topic." },
          entity_id: { type: "string", description: "Entity ID to retrieve audit trail for" },
          limit: { type: "number", description: "Max records to retrieve (default 50)" },
          api_key: { type: "string", description: "Your HederaIntel API key" },
        },
        required: ["entity_id", "api_key"],
      },
    },
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It adds useful context about cost ('Costs 1 HBAR') and scope ('full chronological audit trail'), but lacks details on permissions, rate limits, error handling, or what the output looks like (e.g., format, pagination). This is adequate but has clear gaps for a tool with no 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 a single, efficient sentence that front-loads the core purpose and includes a cost detail, with zero wasted words. It's appropriately sized for the tool's complexity.

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 is minimally complete: it states the purpose and cost. However, for a tool with 4 parameters and blockchain interaction, it lacks details on behavioral traits (e.g., response format, errors) and usage context, leaving room for improvement.

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 doesn't add any meaning beyond what the schema provides (e.g., it doesn't explain 'entity_id' types or 'topic_id' defaults in more detail), meeting the baseline for high coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Retrieve') and resource ('full chronological audit trail for an entity from the Hedera blockchain'), making the purpose understandable. However, it doesn't explicitly differentiate from sibling tools like 'hcs_query' or 'hcs_monitor', which might have overlapping functionality, so it doesn't reach the highest score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It mentions a cost ('Costs 1 HBAR'), but doesn't specify prerequisites, exclusions, or compare it to sibling tools like 'hcs_query' or 'hcs_monitor', leaving the agent with minimal context for selection.

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