agent-receipts
v0.6.0Ed25519-signed receipts for every AI agent action.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
create_receipt
Create an Ed25519-signed receipt with pre-computed SHA-256 hashes. Use when you have already hashed the input/output data externally or need full control over receipt fields. For automatic hashing, use track_action instead. Returns the signed receipt object with receipt_id. The receipt is stored locally in SQLite and can be completed later with complete_receipt.
| Parameter | Type | Description |
|---|---|---|
action * | string | Action name being recorded (e.g., "generate_code", "analyze_data") |
input_hash * | string | Pre-computed SHA-256 hash of the input data in format "sha256:hexstring" |
chain_id | string | Chain ID (auto-generated if not provided) |
confidence | Confidence score 0-1 | |
constraints | array | Array of constraint definitions to evaluate (types: max_latency_ms, max_cost_usd, min_confidence, required_fields, status_must_be, output_schema) |
cost_usd | Cost in USD | |
expires_at | string | ISO datetime when this receipt expires |
latency_ms | Latency in milliseconds | |
metadata | object | Arbitrary metadata |
model | string | null | AI model used |
output_hash | string | null | Pre-computed SHA-256 hash of the output data in format "sha256:hexstring" |
output_summary | string | null | Human-readable summary of the output |
parent_receipt_id | string | null | Parent receipt ID for chains |
receipt_type | string | Receipt type: "action" (default), "verification", "judgment", or "arbitration" |
status | string | Initial status: "pending" (default, complete later) or "completed" |
tags | Tags for categorization | |
tokens_in | Input tokens | |
tokens_out | Output tokens | |
tool_calls | Tools called during the action | |
ttl_ms | number | Time-to-live in milliseconds from now |
complete_receipt
Finalize a pending receipt by recording execution results, costs, and output data. Updates the receipt status to completed, failed, or timeout and re-signs with Ed25519. Use after create_receipt when you need to record results separately from creation (two-phase tracking). Cannot complete an already-completed receipt. Returns the updated signed receipt.
| Parameter | Type | Description |
|---|---|---|
receipt_id * | string | The receipt ID to complete — must be a pending receipt (status: "pending") |
status * | string | Final status: "completed" (success), "failed" (error occurred), or "timeout" (timed out) |
callback_verified | boolean | null | Whether an external callback verified the result |
confidence | Confidence score for output quality, 0.0 to 1.0 | |
cost_usd | Total cost in USD | |
error | Error details if status is "failed" (e.g., {"code": "TIMEOUT", "message": "..."}) | |
latency_ms | Total execution time in milliseconds | |
model | string | null | AI model used during execution |
output_hash | string | null | Pre-computed SHA-256 hash of the output in format "sha256:hexstring" |
output_summary | string | null | Human-readable summary of the execution result |
tokens_in | Input tokens consumed | |
tokens_out | Output tokens generated | |
tool_calls | Names of tools called during execution |
track_action
Create a completed Ed25519-signed receipt for an AI agent action with automatic SHA-256 hashing of input and output data. Records model usage, costs, latency, and constraint evaluations. Returns the signed receipt with receipt_id for future reference. Use this as the primary tool for recording agent actions — prefer over create_receipt + complete_receipt for single-step actions.
| Parameter | Type | Description |
|---|---|---|
action * | string | Action name being recorded (e.g., "generate_code", "summarize_text", "classify_intent") |
chain_id | string | Chain identifier for grouping related receipts — auto-generated if not provided |
confidence | number | Confidence score for the output quality, 0.0 to 1.0 |
constraints | array | Constraint definitions to evaluate against this receipt (e.g., max_latency_ms, max_cost_usd, min_confidence) |
cost_usd | number | Execution cost in USD (e.g., 0.0045) |
expires_at | string | ISO 8601 datetime when this receipt expires (e.g., "2026-12-31T23:59:59Z") |
input | Input data passed to the agent — automatically hashed with SHA-256, raw data is never stored | |
latency_ms | integer | Total execution time in milliseconds |
metadata | object | Arbitrary key-value metadata attached to the receipt |
model | string | AI model used (e.g., "claude-sonnet-4-20250514", "gpt-4o", "gemini-2.0-flash") |
output | Output produced by the agent — automatically hashed with SHA-256, raw data is never stored | |
output_summary | string | Human-readable summary of the output for audit purposes (max 500 chars recommended) |
parent_receipt_id | string | Parent receipt ID for chaining — links this receipt to a previous step |
tags | array | Arbitrary tags for filtering and categorization (e.g., ["production", "critical"]) |
tokens_in | integer | Input tokens consumed by the model |
tokens_out | integer | Output tokens generated by the model |
tool_calls | array | Names of tools called during this action (e.g., ["web_search", "code_exec"]) |
ttl_ms | number | Time-to-live in milliseconds from now — alternative to expires_at |
verify_receipt
Cryptographically verify the Ed25519 signature on a stored receipt to confirm it has not been changed since signing. Receipt format v2 signs every field (summary, cost, model, metadata, files and the chain link); legacy v1 receipts sign 12 core fields only. Returns verified, sig_version and covers_all_fields. To check a whole chain for edited, removed or forked receipts, use the CLI: agent-receipts verify-chain <chain_id>. Use to audit receipts before using them as evidence or before completing payments based on agent work.
| Parameter | Type | Description |
|---|---|---|
receipt_id * | string | The receipt ID to verify — must exist in local storage |
get_receipt
Retrieve a single receipt by its ID from local SQLite storage. Returns the full receipt object including all 27 fields: identity, timestamps, action data, performance metrics, constraints, cryptographic proof, and metadata. Returns an error message if the receipt ID does not exist. Use to inspect a specific receipt or retrieve it before verification.
| Parameter | Type | Description |
|---|---|---|
receipt_id * | string | The receipt ID to retrieve (format: "rcpt_" followed by 12 alphanumeric characters) |
list_receipts
Query and paginate receipts from local SQLite storage with optional filtering by agent, action, status, environment, type, chain, or tag. Supports sorting by timestamp, cost, or latency. Returns paginated results with total count, page info, and has_next/has_prev flags. Default: 50 receipts per page, sorted by timestamp descending. Use to audit agent activity, generate reports, or find specific receipts.
| Parameter | Type | Description |
|---|---|---|
action | string | Filter by action name (exact match) |
agent_id | string | Filter by agent ID (exact match) |
chain_id | string | Filter to receipts in a specific chain |
environment | string | Filter by environment: "development", "production", "staging", or "test" |
limit | integer | Results per page, 1 to 100 (default: 50) |
page | integer | Page number, starting at 1 (default: 1) |
receipt_type | string | Filter by type: "action", "verification", "judgment", or "arbitration" |
sort | string | Sort field and direction in format "field:asc" or "field:desc" (e.g., "timestamp:desc", "cost_usd:asc") |
status | string | Filter by status: "pending", "completed", "failed", or "timeout" |
tag | string | Filter to receipts containing this tag |
get_chain
Retrieve all receipts belonging to a chain, ordered by timestamp ascending to show the sequence of operations. A chain groups related receipts from a multi-step agent workflow. Returns the complete receipt objects for every step. Use to audit a complete workflow, calculate total chain cost and duration, or identify which step in a pipeline failed.
| Parameter | Type | Description |
|---|---|---|
chain_id * | string | The chain ID to retrieve (format: "chain_" followed by 8 alphanumeric characters) |
get_public_key
Export the Ed25519 public key used to sign all receipts on this instance. Returns the key as a 64-character hex string. Share this key with clients or third parties so they can independently verify receipt signatures without accessing your private key. The private key never leaves your machine — only the public key is needed for verification.
judge_receipt
Start an AI judgment evaluation for a receipt by creating a pending judgment receipt and returning a structured evaluation prompt. The host model (you) evaluates the receipt's output against the provided rubric criteria and then calls complete_judgment with the results. Use to assess output quality beyond simple pass/fail constraints — supports weighted criteria, partial verdicts, and confidence scores. Judgment receipts are themselves Ed25519-signed for auditability.
| Parameter | Type | Description |
|---|---|---|
receipt_id * | string | The receipt ID to evaluate — the original action receipt |
rubric * | object | Evaluation rubric with criteria array. Each criterion needs: name (string), description (string), weight (0.0-1.0), and optional passing_threshold (0.0-1.0, default 0.7). Also set: passing_threshold (… |
output_summary_for_review | string | The actual output content to evaluate — provide if output_summary on the receipt is insufficient for evaluation |
complete_judgment
Submit evaluation results to finalize a pending judgment receipt created by judge_receipt. Records the verdict, overall score, per-criterion scores and reasoning, and confidence. The judgment receipt is re-signed with Ed25519 and linked to the original receipt via parent_receipt_id. Returns the judgment receipt ID, verdict, score, and chain ID. Use immediately after evaluating the prompt returned by judge_receipt.
| Parameter | Type | Description |
|---|---|---|
confidence * | number | Your confidence in this evaluation, 0.0 to 1.0 |
criteria_results * | array | Array of per-criterion results. Each item needs: criterion (name string), score (0.0-1.0), reasoning (explanation string) |
judgment_receipt_id * | string | The pending judgment receipt ID returned by judge_receipt |
overall_reasoning * | string | Overall explanation of the evaluation verdict |
score * | number | Overall quality score from 0.0 to 1.0 |
verdict * | string | Overall evaluation result: "pass" (meets threshold), "fail" (below threshold), or "partial" (mixed results) |
get_judgments
Retrieve all judgment receipts associated with a given receipt ID. Judgment receipts are linked via parent_receipt_id. Returns an array of judgment receipt objects ordered by timestamp, including verdict, score, criteria results, and confidence. Use to review the evaluation history of a receipt, compare multiple judgments, or audit AI quality assessments. Returns empty array if no judgments exist.
| Parameter | Type | Description |
|---|---|---|
receipt_id * | string | The original receipt ID to get judgments for (not the judgment receipt ID) |
cleanup
Delete receipts that have passed their expiration time based on the expires_at field in metadata. Expired receipts are receipts where metadata.expires_at is set and is earlier than the current time. Supports dry_run mode to preview deletions without committing. Returns count of deleted receipts and remaining total. Use periodically to manage storage and enforce TTL policies set during receipt creation. Set cleanup_memory to also soft-delete expired memory observations.
| Parameter | Type | Description |
|---|---|---|
cleanup_memory | boolean | Also clean up expired memory observations (soft-delete). Defaults to false. |
dry_run | boolean | If true, returns what would be deleted without actually deleting. Defaults to false. |
generate_invoice
Generate a client invoice from cryptographically signed receipts within a date range. Aggregates receipt data by agent, action, or day and calculates total costs, token usage, and receipt counts. Supports JSON, CSV, and Markdown output formats. Each line item references a signed receipt for verifiable billing. Use to bill clients for AI agent work with cryptographic proof of every billed action.
| Parameter | Type | Description |
|---|---|---|
from * | string | Invoice period start date in ISO 8601 format (e.g., "2026-01-01" or "2026-01-01T00:00:00Z") |
to * | string | Invoice period end date in ISO 8601 format (e.g., "2026-01-31" or "2026-01-31T23:59:59Z") |
actions | array | Filter to specific action names only |
agent_ids | array | Filter to specific agent IDs only |
client_email | string | Client email address |
client_name | string | Client or bill-to name for the invoice header |
constraints_passed_only | boolean | If true, only include receipts where all constraints passed |
format | string | Output format: "json" (structured data), "csv" (spreadsheet), or "md" (markdown table) |
group_by | string | How to group line items: "action" (by action name), "agent" (by agent ID), "day" (by date), or "none" (single total) |
include_receipts | boolean | If true, includes full receipt objects in JSON output for full auditability |
notes | string | Additional notes to include in the invoice |
payment_terms | string | Payment terms text (e.g., "Net 30", "Due on receipt") |
provider_email | string | Your email address |
provider_name | string | Your company or provider name |
get_started
Display a getting-started guide with usage examples for all Agent Receipts tools. Shows how to record agent actions, verify receipts, use receipt chains, evaluate with constraints, and generate invoices. Call this tool first when setting up Agent Receipts or when you need a reference for available tools and their typical usage patterns.
memory_observe
Store a memory observation about a person, project, preference, or any entity. Automatically creates the entity if it doesn't exist. Every observation is cryptographically signed and linked to a receipt.
| Parameter | Type | Description |
|---|---|---|
content * | string | The observation/fact to remember |
entity_name * | string | Name of the entity (person, project, tool, etc.) |
entity_type * | string | Type of entity |
confidence | string | How confident you are in this observation (default: medium) |
context | string | What conversation or task produced this observation |
scope | string | Who can see this memory (default: agent) |
tags | array | Tags for categorization |
ttl_seconds | number | Time-to-live in seconds. After this duration, the observation expires and is excluded from recall but retained for audit. |
memory_recall
Search and retrieve stored memories. Use text search to find relevant observations across all entities, or filter by entity type, specific entity, or scope. Every recall is logged as a receipt.
| Parameter | Type | Description |
|---|---|---|
audited | boolean | Create a signed receipt for this read operation (default: false) |
entity_id | string | Get memories for a specific entity |
entity_type | string | Filter by entity type |
include_forgotten | boolean | Include soft-deleted memories (default: false) |
limit | number | Max results to return (default: 20, max: 100) |
query | string | Text to search for across all observations |
scope | string | Filter by memory scope |
memory_forget
Forget a specific observation or an entire entity. This is a soft delete — the memory is marked as forgotten but retained for audit purposes. The forget operation itself is recorded as a signed receipt.
| Parameter | Type | Description |
|---|---|---|
entity_id | string | Entity to forget entirely (all its observations) |
observation_id | string | Specific observation to forget |
reason | string | Why this memory is being forgotten |
memory_entities
List known entities (people, projects, organizations, etc.) with optional filtering. Returns entities with their observation counts.
| Parameter | Type | Description |
|---|---|---|
entity_type | string | |
include_forgotten | boolean | Include forgotten entities (default: false) |
limit | number | Max results (default: 20) |
query | string | Search entity names and aliases |
scope | string |
memory_relate
Create a relationship between two entities (e.g., "Amin" builds "ModQuote"). Relationships are bidirectional for querying but stored with a direction.
| Parameter | Type | Description |
|---|---|---|
from_entity_id * | string | Source entity ID |
relationship_type * | string | Type of relationship (e.g., "builds", "uses", "works_at", "prefers") |
to_entity_id * | string | Target entity ID |
context | string | What established this relationship |
strength | string |
memory_provenance
Get the full provenance chain for a memory observation. Shows when it was created, which conversation produced it, which agent made the observation, and every subsequent modification.
| Parameter | Type | Description |
|---|---|---|
observation_id * | string | The observation to trace |
memory_audit
Generate an audit report of memory operations. Shows what was remembered, forgotten, merged, and by which agents over a time period.
| Parameter | Type | Description |
|---|---|---|
agent_id | string | Filter by agent |
entity_id | string | Filter by entity |
from | string | Start date (ISO 8601) |
to | string | End date (ISO 8601) |
memory_context
Get a complete context dump of all stored memories — top entities, recent observations, active relationships, and preferences. Call this at the start of a conversation to understand what is already known about the user, their projects, and their preferences. Every context pull is logged as a signed receipt.
| Parameter | Type | Description |
|---|---|---|
audited | boolean | Create a signed receipt for this read operation (default: false) |
max_entities | number | Maximum entities to return, ordered by activity (default: 10, max: 50) |
max_observations | number | Maximum recent observations to return (default: 20, max: 100) |
scope | string | Filter memories by scope (default: returns all accessible scopes) |
memory_export_bundle
Export memories as a portable, verifiable bundle. Includes entities, observations, relationships, source receipts, and the public key needed to verify them. Share with other agents or import into another Agent Receipts instance.
| Parameter | Type | Description |
|---|---|---|
description | string | Description of what this bundle contains |
entity_ids | array | Export specific entities (default: all) |
include_forgotten | boolean | Include forgotten/deleted memories (default: false) |
include_receipts | boolean | Include source receipts for verification (default: true) |
memory_import_bundle
Import a memory bundle from another Agent Receipts instance. Verifies checksums before importing. Skips memories that already exist locally. The import operation itself is recorded as a signed receipt.
| Parameter | Type | Description |
|---|---|---|
bundle * | object | The memory bundle JSON object to import |
skip_existing | boolean | Skip entities/observations that already exist (default: true) |