Mercury · Workflow guide
Read-only Mercury cash review for AI agents
Have your AI agent read Mercury accounts and transactions through Loggie and prepare a cash movement review with exceptions, with no way to move money.
Who this is for: Finance operators and founders who need a repeatable transaction review before their regular cash check-in.
Before you start
- A Mercury API connection supported for your account, with read-only provider credentials stored in Loggie.
- An agent granted only account and transaction reads. Exclude payments, transfers, recipient changes, and other money-moving operations.
- Approved accounts, reporting dates, currency treatment, materiality rules, and a private finance-only delivery destination.
In your Loggie workspace, connect Mercury, create an agent identity, and review its access. On the agent’s machine, use Node.js 20 or later and initialize the CLI:
npm install -g @loggie-ai/cli
loggie init
loggie discoverEnter the agent’s Loggie key through the initialization prompt. Keep provider credentials in the connection setup, not in the agent prompt. Use the connection slug returned by discovery in the examples below.
Step-by-step workflow
Define the finance review, including its boundaries
Start with completed cash movements over an agreed period. Decide how to treat pending and failed transactions, reversals, and transfers between your own accounts. Without that definition, a transfer can look like both new revenue and a new expense.
Choose a few review rules with the finance owner: an unfamiliar counterparty, an amount above a threshold, or a possible duplicate. These are reasons to inspect a transaction, not automatic conclusions about fraud or accounting classification.
Verify the account read before expanding the workflow
Connect Mercury in Loggie and initialize the agent’s CLI. Discover the actual connection slug and inspect the endpoints before calling them. Mercury below is an example slug.
First confirm an account read succeeds for the intended business. Then retrieve a bounded transaction page. An access or routing error is a failed run, not a zero balance. Resolve the connection with the workspace owner before producing a cash report, using the same read-only credential.
loggie discover mercury --endpoint /api/v1/accounts --method GET loggie call mercury GET /accounts --pretty loggie discover mercury --endpoint /api/v1/transactions --method GET loggie call mercury GET /transactions --query 'limit=100' --prettyReconcile the reporting window and flag exceptions
Apply the agreed date and status definitions and follow the provider’s transaction pagination. Use transaction IDs to deduplicate the fetched set. Keep separate currencies separate and identify internal transfers before calculating net external cash movement.
For each exception, show the ID, date, status, amount, and the exact rule it matched. Avoid putting full account identifiers or sensitive counterparty details into a broadly shared summary. A possible duplicate needs comparison of identifiers and settlement status before anyone acts.
Give finance a short review packet
Return period totals alongside a compact exception list and a clear coverage statement. Link or identify the source records so a finance owner can reconcile them against Mercury and the accounting system. Label pending activity separately from posted cash.
Schedule the report in the agent runtime and send it only to the approved finance destination. Loggie provides the API access boundary. Paying a bill, transferring funds, editing a recipient, or posting accounting entries belongs in a separate explicitly approved workflow.
Mercury agent prompt
Adapt this prompt to your connected account and the scope you have approved.
Read only the approved Mercury accounts and transactions for the agreed reporting window. Verify successful responses and complete pagination. Separate pending activity, reversals, currencies, and internal transfers. Return cash movement totals and exceptions under the finance owner’s rules, with source transaction IDs. Do not infer fraud, book entries, create recipients, pay, or transfer funds.Example Mercury report
Example output with invented data.
Cash review: Operating + Payroll, last 7 days (USD, posted only)
External inflows $48,200.00
External outflows $31,750.40
Net external +$16,449.60
Internal transfers excluded: $20,000.00 Operating → Payroll
Pending, not in totals: 2 transactions, $1,180.00
Review items
1. $12,500.00 to Northwind Design: first payment to this counterparty
2. $899.00 to Cloud Host Inc, twice on the same day: possible duplicate
No payments, transfers, or recipient changes made.Success checks
- Reconcile a small reporting window with Mercury using the same accounts, posting status, and date definition.
- Verify internal transfers, pending transactions, and duplicate API pages do not inflate totals.
- Confirm both provider credentials and Loggie permissions exclude money movement.
Pitfalls
- Transaction totals alone do not establish available cash, runway, profitability, or an accounting balance.
- A request failure must stop the report; never replace missing financial data with zeros.
- Keep the report and raw transaction data within the approved finance audience.
- Discovery uses the full documented path, while calls are appended to the connection base. The examples assume https://api.mercury.com/api/v1; with an origin-root base, include /api/v1 in each call.