Skip to main content
Glama
agledger-ai

@agledger/mcp-server

Official
by agledger-ai

Verify Audit Export

agledger_verify
Read-onlyIdempotent

Verifies AGLedger audit exports offline by decoding COSE_Sign1 envelopes, recomputing SHA-256 hashes, walking the hash chain, and checking Ed25519/ES256 signatures without network calls.

Instructions

Verify an AGLedger record audit export offline (format 2.0, COSE_Sign1). Decodes each entry's tagged COSE_Sign1 envelope (RFC 9052), recomputes sha256 over the envelope bytes, walks the hash chain, cross-checks the protected-header chain claim against the row columns, and verifies every envelope signature (Ed25519 or ES256, dispatched from the trusted key material; anything else fails closed). No network calls. For an independent audit, pass publicKeys obtained out of band (GET /v1/verification-keys or /.well-known/scitt-keys) rather than trusting the export's embedded keys; result.keyProvenance reports out-of-band vs embedded key use. On failure, brokenAt pinpoints the first entry that failed and its canonical code (CHAIN_HASH_MISMATCH, CHAIN_LINK_BROKEN, CHAIN_GENESIS_INVALID, CHAIN_COSE_DECODE_FAILED, CHAIN_COSE_HEADER_MISMATCH, CHAIN_PAYLOAD_BINDING_MISMATCH, CHAIN_SIGNATURE_INVALID, CHAIN_SIGNATURE_MISSING_KEY, CHAIN_KEY_POLICY_VIOLATION, CHAIN_ALG_MISMATCH, CHAIN_SIGNING_KEY_DRIFT, CHAIN_UNSUPPORTED_ALGORITHM (this build cannot compute the key's algorithm; upgrade, never a pass), CHAIN_POSITION_GAP, CHAIN_MALFORMED_ENTRY, UNSUPPORTED_FORMAT, CHAIN_EMPTY). Obtain the export via agledger_api with method=GET, path=/v1/records/{id}/audit-export. For the raw COSE_Sign1 stream, use path=/v1/records/{id}/attestation.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
exportNoThe audit export as a JSON-encoded string (the response body from GET /v1/records/{id}/audit-export, JSON.stringify'd). Native JSON objects are also accepted for compatibility.
publicKeysNoOptional out-of-band signing keys. Accepts any of these as a JSON-encoded string (or a native object/array): a compact map '{"key-1":"MCowBQYDK2VwAyEA..."}' (values are base64 SPKI DER; Ed25519 keys start "MCowBQYDK2Vw", P-256 keys "MFkwEwYHKoZIzj0"), the list shape '[{"keyId":"key-1","publicKey":"MCowBQYDK2VwAyEA..."}]', or the raw GET /v1/verification-keys response envelope ('{"data":[...], ...}'); the .data array is unwrapped automatically, so the agledger_api response can be passed straight through). Merged over any keys embedded in the export.
requireKeyIdNoIf set, every entry must reference this keyId. Rejects exports signed by a retired or unexpected key even if cryptographically valid.
requireOutOfBandKeysNoHigh-assurance: refuse keys embedded in the export. An entry whose only key is export-embedded fails CHAIN_KEY_POLICY_VIOLATION, forcing verification against keys supplied out of band via publicKeys.
Behavior5/5

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

Annotations already declare readOnly, idempotent, non-destructive. The description adds significant context: 'No network calls', 'anything else fails closed', 'On failure, brokenAt pinpoints...', and the security recommendation about out-of-band keys. No contradiction.

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 long but information-dense; every sentence serves a purpose. It's front-loaded with the primary action and then systematically covers algorithms, security notes, failure handling, and tool compatibility. Slightly dense as a single paragraph but warranted.

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?

With no output schema, the description takes on the burden of explaining outcomes. It describes failure output (brokenAt plus canonical codes) and key provenance, but does not explicitly describe a successful result's shape (e.g., whether it returns a boolean or summary), leaving a small gap.

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% with detailed parameter descriptions, but the tool description adds extra context beyond the schema: e.g., it explains where to fetch publicKeys (GET /v1/verification-keys) and that result.keyProvenance distinguishes key sources, which isn't in the schema.

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 opens with a specific verb and resource: 'Verify an AGLedger record audit export offline (format 2.0, COSE_Sign1).' It clearly distinguishes itself from siblings by directing the user to agledger_api for obtaining the export and to attestation for raw stream.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It explicitly states when to use this tool ('For an independent audit, pass publicKeys obtained out of band') and how to obtain the input ('Obtain the export via agledger_api...'), and contrasts with alternatives (raw COSE_Sign1 stream via attestation).

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/agledger-ai/mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server