Skip to main content
Glama

Append a tamper-evident audit-chain entry

append_audit_entry

Append a tamper-evident entry to a hash-chained audit log, returning the updated chain so a third party can verify event integrity independently.

Instructions

Appends one entry to an append-only, hash-chained audit log and returns the new (longer) chain. Each entry's hash binds its payload, index, createdAt, a fixed format tag (formatVersion, currently "audit-chain-kit/v1"), and the previous entry's hash together, so any later tampering with an earlier entry -- or an entry produced by an incompatible version of audit-chain-kit -- breaks the chain in a way verify_audit_chain will detect. Use this wherever you need a tamper-evident record of events (agent actions, approvals, state transitions) that a skeptical third party can later verify independently. This function does not persist anything itself -- store the returned chain (or just the new entry) in whatever your app already uses.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
chainYesThe existing chain, in order, exactly as previously returned/stored. Pass [] to start a new chain.
payloadYesCaller data for the new entry -- any JSON-serializable value.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.4/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so richly: it discloses the append-only hash-chain mechanism, what each entry hash binds, the fixed format tag, that tampering or an incompatible format version will break the chain in a detectable way, and crucially that the function does not persist anything itself. This is exactly the behavioral context an agent needs before invoking it.

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?

The description is front-loaded with purpose and return value, then mechanism, then usage guidance, then the important non-persistence caveat. It is somewhat long, but nearly every sentence carries useful technical information for an annotation-free tool handling a hash chain.

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

Completeness5/5

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

Given the complexity of a tamper-evident hash chain, the absence of annotations, and the lack of an output schema, the description is complete enough: it explains the return value, persistence expectations, verification path, and versioning constraints. An agent has what it needs to call the tool correctly.

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 input schema already documents both parameters and their nested fields thoroughly. The description adds thematic explanation of how the chain and payload are bound by hashes, but does not add parameter-level syntax or format details beyond what the schema provides. Baseline 3 is appropriate.

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 states a precise verb and resource: appending one entry to an append-only, hash-chained audit log and returning the new longer chain. It also names verify_audit_chain and explains how tampering or version mismatch will be detected there, which clearly distinguishes it from the verification sibling.

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?

It gives explicit usage context: 'Use this wherever you need a tamper-evident record of events (agent actions, approvals, state transitions) that a skeptical third party can later verify independently.' It also clarifies the non-persistence behavior and what to do with the return value, though it does not explicitly state when not to use it or name a direct alternative.

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