<!-- Generated from typed source content. Do not edit this file. -->
# 146 Agent Tools. One Balanced Ledger.

> How AI handles changing statement formats, match rules classify the known cases, and a double-entry ledger turns scattered financial data into a personal CFO.

- Author: Paul Yu
- Role: Senior Analytics Engineer
- Employer: Clovis
- Year: 2026
- Theme: Agent Tooling
- Human article: [https://paul-yu.com/case-studies/clovis-ai-action](https://paul-yu.com/case-studies/clovis-ai-action)
- Structured data: [https://paul-yu.com/agent/case-studies/clovis-ai-action.json](https://paul-yu.com/agent/case-studies/clovis-ai-action.json)

## Evidence

| Value | Measure | Evidence level |
| --- | --- | --- |
| 146 | AI tools with defined inputs | Repository backed |
| 75 | read-only tools | Repository backed |
| 71 | tools with dry-run support | Repository backed |
| 18 | tools that start in dry-run mode | Repository backed |

## Situation

A finance agent needs to read accounts, prepare budgets, and sometimes change the books. A vague request or silent edit could create a bad transaction and hide how it happened.

## Task

Let AI do real financial work without giving it open access to the database or trusting a prompt to keep every action safe.

## Action

I built 146 small AI tools on top of the same accounting core used by the command line. Read and write actions are separate. Risky changes support previews, balanced journals, and an audit record.

## Result

AI can inspect the ledger, prepare work, and make approved changes through a clear tool layer. Seventy-five tools are read only, 71 support dry runs, and 18 start in dry-run mode.

## System flow

User request → Narrow AI tool → Accounting rules → Reviewable result

## Technical notes

### Tool boundary

The agent gets small tools with known inputs instead of a general database connection. Each tool has one job, so the software can check the request before it reaches the books.

### Dry-run workflow

A dry run shows what a risky action would change without saving it. The user or agent can check the plan before posting the real journal entry.

### Double-entry invariant

Every journal must balance. This rule lives in the accounting core, so the command line and every AI tool follow the same test.

### Audit trail

Material actions leave a record of what ran and what changed. A result can be traced back instead of becoming a silent edit.

## Ownership

I designed and built the accounting core, AI tool layer, safety rules, command line, local ledger, audit system, and release path.

## Limitations

The repository proves the tool design and tested controls. It does not prove that an agent can handle every financial choice, and the system has not had an independent security audit.

## Takeaway

AI is most useful at the changing edge. Stable accounting rules still own the trusted core.

## Tools

TypeScript, SQLite, MCP, QFX / OFX, Match rules, Double-entry accounting, Audit logs
