Skip to main content
Glama

hcs_verify_record

Verify compliance records on the Hedera blockchain to confirm their existence and ensure they remain untampered, using HBAR micropayments for each verification.

Instructions

Verify a compliance record exists on the Hedera blockchain and has not been tampered with. Costs 0.5 HBAR.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
api_keyYesYour HederaIntel API key
record_idYesRecord ID returned when the record was written
topic_idNoHCS topic ID where the record was written. Defaults to the HederaIntel platform topic.

Implementation Reference

  • The implementation of the 'hcs_verify_record' tool logic, which fetches messages from a Hedera HCS topic and verifies the record's integrity by comparing hashes.
    if (name === "hcs_verify_record") {
      const payment = chargeForTool("hcs_verify_record", args.api_key);
      const base = getMirrorNodeBase();
      const topicId = args.topic_id || PLATFORM_TOPIC;
    
      const response = await axios.get(
        `${base}/api/v1/topics/${topicId}/messages?limit=100&order=asc`
      );
    
      const messages = response.data.messages || [];
      let foundRecord = null;
    
      for (const msg of messages) {
        try {
          const content = Buffer.from(msg.message, "base64").toString("utf-8");
          const record = JSON.parse(content);
          if (record.record_id === args.record_id) {
            const { hash, ...recordWithoutHash } = record;
            const computedHash = crypto
              .createHash("sha256")
              .update(JSON.stringify(recordWithoutHash))
              .digest("hex");
    
            foundRecord = {
              record_id: record.record_id,
              record_type: record.record_type,
              entity_id: record.entity_id,
              written_at: record.written_at,
              consensus_timestamp: msg.consensus_timestamp,
              hash_valid: computedHash === hash,
              tampered: computedHash !== hash,
              sequence_number: msg.sequence_number,
            };
            break;
          }
        } catch (e) {
          continue;
        }
      }
    
      if (!foundRecord) {
        return {
          verified: false,
          record_id: args.record_id,
          topic_id: topicId,
          error: "Record not found on blockchain",
          payment,
        };
      }
    
      return {
        verified: true,
        tampered: foundRecord.tampered,
        hash_valid: foundRecord.hash_valid,
        topic_id: topicId,
        ...foundRecord,
        payment,
        timestamp: new Date().toISOString(),
      };
    }
  • Schema definition for the 'hcs_verify_record' tool.
    {
      name: "hcs_verify_record",
      description: "Verify a compliance record exists on the Hedera blockchain and has not been tampered with. Costs 1.0 HBAR.",
      inputSchema: {
        type: "object",
        properties: {
          topic_id: { type: "string", description: "HCS topic ID where the record was written. Defaults to the HederaIntel platform topic." },
          record_id: { type: "string", description: "Record ID returned when the record was written" },
          api_key: { type: "string", description: "Your HederaIntel API key" },
        },
        required: ["record_id", "api_key"],
      },
    },
Behavior4/5

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

With no annotations provided, the description carries the full burden and discloses key behavioral traits: it's a read operation (verification), involves blockchain interaction, and specifies a cost ('Costs 0.5 HBAR'), though it doesn't cover error handling or response format.

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 with the core purpose in the first sentence and adds critical cost information in a second, efficient sentence with zero wasted words.

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?

For a verification tool with no annotations and no output schema, the description adequately covers purpose and cost, but lacks details on response format, error conditions, or blockchain-specific behaviors, leaving gaps in completeness.

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 fully documents all three parameters. The description adds no additional parameter semantics beyond what the schema provides, meeting the baseline for high coverage.

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 specific action ('verify'), resource ('compliance record'), and purpose ('exists on the Hedera blockchain and has not been tampered with'), distinguishing it from siblings like hcs_write_record (creation) and hcs_audit_trail (history tracking).

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 description implies usage for verifying existing records, but lacks explicit guidance on when to use this tool versus alternatives like hcs_query or hcs_audit_trail, or prerequisites beyond the required parameters.

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