Verify the full ledger chain
verify_ledgerVerify the entire ledger's integrity by checking all entry signatures and hash-chain linkage, detecting forged, deleted, reordered, or spliced records.
Instructions
Verifies every entry's signature AND the unbroken hash-chain linkage across the entire local ledger in one call, catching forged receipts as well as deleted, reordered, or spliced-in entries that a single-receipt check (verify_receipt) cannot detect on its own. Call this for a full integrity audit of the local ledger before trusting exported totals, or periodically as a tamper-detection check. Requires an existing ledger (see list_ledger); an empty ledger verifies as valid with entryCount 0.
Side effects: read-only, reads the local ledger file, no writes, no network calls, fully idempotent. Verification stops at the first invalid entry rather than continuing past it, since the hash chain is meaningless from that point forward.
Parameters: local (optional bool, default false) - same meaning as in list_ledger and record_usage. Equivalent CLI: computeledger ledger verify --json (add --local to match local=true).
Returns {"valid": bool, "entryCount": , "firstInvalidIndex": <int|null>, "firstInvalidReason": "<invalid_signature|hash_mismatch|unsupported_version|malformed_receipt|chain_broken|null>"}. is_error is set to true whenever valid is false, so a broken chain is visible both in the payload and the MCP error flag.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| local | No | Use the current directory's .computeledger instead of the home directory |