Skip to main content
Glama

Append a tamper-evident audit-chain entry

append_audit_entry
Read-only

Add a tamper-evident entry to a hash-chained audit log for verifiable records of agent actions, approvals, or state changes. Store the returned chain; later verification detects altered entries.

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.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "chain": "<chain>",
      "payload": "<payload>"
    },
    "name": "append_audit_entry"
  }
}

Input 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.6/5.0
Behavior5/5

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

ReadOnlyHint=true and openWorldHint=false are consistent with the description's explicit statement that 'this function does not persist anything itself' and returns a value the caller must store. Beyond the annotations, it discloses the hash-binding inputs, the fixed format tag, and that incompatible-version entries break the chain — exactly the behavior an agent cannot infer from structured fields.

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?

Purpose is front-loaded in the first clause, followed by mechanism, use cases, and a persistence caveat. The middle sentence is dense but every clause carries information (payload, index, createdAt, format tag, prevHash) that matters for correct use; minor tightening is possible but nothing is filler.

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?

With only two parameters, no output schema, and no destructive hints, the description covers what an agent still needs: the return value, the non-persistence contract, and the interoperability constraint on formatVersion. Nothing required to call it correctly is missing.

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 coverage is 100%, so the baseline is 3, and the description earns a bump by clarifying that the chain argument is the previously returned/stored chain in order and that the formatVersion tag is fixed at 'audit-chain-kit/v1'. It adds context about what the chain represents without restating every field.

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?

States a specific verb and resource ('Appends one entry to an append-only, hash-chained audit log') and even names the return value ('returns the new (longer) chain'). It explicitly distinguishes itself from verify_audit_chain by positioning that sibling as the detection mechanism, so an agent can separate the write and verify roles without opening either schema.

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?

Gives a concrete usage trigger ('wherever you need a tamper-evident record of events (agent actions, approvals, state transitions)') and identifies verify_audit_chain as the companion tool for checking the result. It stops short of stating when not to use it or what to do if a chain is already broken, so guidance is clear but not exhaustive.

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