Search paid expenses
search_expensesSearch PAID EXPENSES already posted to the books (the /expenses ledger) by any combination of: reference (partial), text in the memo/description (partial), date range, amount range, and category account. Returns compact rows (expenseId, date, amount, category account code + name, memo, reference), newest first, capped — with a more flag. Every row also says whether the ORIGINAL RECEIPT is on file: hasAttachment plus an attachments list (filename, media type, size) — an empty list means genuinely no receipt is attached, not "unknown". To read one, pass the row's expenseId and attachmentId to get_attachment. ALWAYS check here BEFORE filing an expense draft (create_expense_draft): if the same receipt is already booked, filing again would double-book it. search_documents does NOT cover paid expenses — this tool is the only way to see them.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | No | ||
| ref | No | NOT a filter on this tool. Pass the supplier/receipt reference as `reference`. | |
| from | No | ||
| memo | No | NOT a filter on this tool. Pass memo text as `text`. | |
| text | No | Partial text to match in the expense memo/description (case-insensitive contains). | |
| refNo | No | NOT a filter on this tool. Pass the supplier/receipt reference as `reference`. | |
| number | No | NOT a filter on this tool. Pass the supplier/receipt reference as `reference` — a posted expense has no document number of its own. | |
| vendor | No | NOT a filter on this tool. A posted expense carries no party field here — search the supplier name as `text` (it matches the memo/description) or as `reference`. | |
| account | No | NOT a filter on this tool. Pass the chart-of-accounts code as `accountCode` (exact). | |
| category | No | NOT a filter on this tool. Pass the category by its chart-of-accounts code as `accountCode` (exact) — get codes from expense_accounts. | |
| supplier | No | NOT a filter on this tool. A posted expense carries no party field here — search the supplier name as `text` (it matches the memo/description) or as `reference`. | |
| maxAmount | No | ||
| minAmount | No | ||
| reference | No | Partial supplier/receipt reference (case-insensitive contains). | |
| accountCode | No | Restrict to one expense category by its account code (exact). | |
| description | No | NOT a filter on this tool. Pass memo text as `text`. |