Skip to main content
Glama
mnemox-ai

TradeMemory Protocol

by mnemox-ai

Verify Audit Chain

verify_audit_chain
Read-onlyIdempotent

Validate trade audit chain integrity by checking hash continuity across a sequence range. Returns verified status, checked count, and first break point if tampering is detected.

Instructions

Verify the integrity of the audit chain.

Walks the chain from from_seq (default: 1, the genesis record) to to_seq (default: latest), checking that every record's prev_hash matches the previous record's data_hash, and that each data_hash equals SHA256(prev_hash || content_hash).

Returns a dict with verified, checked_count, first_break_at, reason. A first_break_at of None with verified=True means the chain is intact across the verified range.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
to_seqNoEnding sequence_num (inclusive). None = through latest.
from_seqNoStarting sequence_num (inclusive). None = from beginning.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.5.4

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint and destructiveHint=false, so the safety profile is covered. The description adds real behavioral value beyond that: the exact invariants checked, the default range (genesis to latest), and what a successful vs. broken result looks like. It stops short of noting cost/runtime on large chains or behavior when from_seq > to_seq.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loads the purpose in one line, then explains the mechanism, defaults, and return contract in tight sentences. Slightly long, but every sentence carries information an agent needs to interpret the result; nothing is padding.

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?

An output schema exists, so the return-value sentence is more than strictly required, but it usefully explains that verified=True with first_break_at=None means the range is intact. Combined with annotations and full schema coverage, the definition gives an agent everything needed to call and interpret the tool correctly.

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 description coverage is 100%, so the baseline is 3, but the description adds meaning: from_seq is the genesis record by default and to_seq runs through latest, and both bounds are framed as the inclusive verified range. Minor wording drift exists between the description's 'default: 1' and the schema's default of null, though the semantics ('from beginning') match.

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?

States a specific verb and resource ('Verify the integrity of the audit chain') and immediately clarifies the scope by describing the walk from from_seq to to_seq. It implicitly distinguishes itself from the sibling verify_audit_hash by describing whole-chain linkage checks rather than single-hash verification, though it never names the sibling explicitly.

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?

Usage is implied by the mechanics (walking the chain, checking prev_hash/data_hash linkage) and the defaults make the tool's natural invocation obvious. However, it never states when to reach for this over verify_audit_hash, get_daily_root, or export_audit_trail, nor any preconditions for running a verification.

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