@hoagsmedia/frgur-mcp-server 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.1 — 2026-07-06
4
+
5
+ - **Skip the double AI pass (HOA-423).** `import_receipt_file` now takes an optional `extracted` object (`{vendor, amountCents, date, category?}`) — the fields your AI client already read off the receipt. When provided, frugr uses them directly instead of running (and billing) its own server-side vision extraction. The tool description instructs the model to include it whenever it has seen the receipt. Fields still land in Needs Review for human approval either way.
6
+
3
7
  ## 0.3.0 — 2026-07-06
4
8
 
5
9
  - **Import receipts from a local file (HOA-416).** New client-side tool `import_receipt_file({ filePath })`: reads a receipt (PDF/JPEG/PNG/WebP/GIF/HEIC, ≤3 MB) from your machine, base64s it, and forwards to frugr's new `propose_expense_from_receipt` server tool. frugr extracts the receipt and either attaches it to the matching unreceipted expense or files a provisional draft in **Needs Review** — never a direct ledger write. Ask your AI client: _"import ~/Downloads/receipt.pdf into my books."_
package/index.mjs CHANGED
@@ -92,15 +92,35 @@ export function mimeFromExtension(filePath) {
92
92
  const IMPORT_RECEIPT_TOOL = {
93
93
  name: 'import_receipt_file',
94
94
  description:
95
- 'Import a receipt from a file on THIS computer (e.g. ~/Downloads/receipt.pdf). Reads the ' +
96
- 'file locally and proposes it to frugr, which files it in the Needs Review queue for your ' +
97
- 'approval. Max 3 MB; PDF, JPEG, PNG, WebP, GIF, or HEIC.',
95
+ 'Import a receipt from a file on the machine running THIS MCP bridge process (e.g. ' +
96
+ "~/Downloads/receipt.pdf on the user's computer). filePath resolves against the bridge " +
97
+ "host's filesystem ONLY paths from a chat-upload sandbox (e.g. /mnt/user-data/uploads/…) " +
98
+ 'or any other machine will NEVER resolve here; do not retry them. For files you can read ' +
99
+ 'but the bridge cannot, call propose_expense_from_receipt with base64 instead (3 MB decoded ' +
100
+ 'cap; downscale large scans first). Max 3 MB; PDF, JPEG, PNG, WebP, GIF, or HEIC. If you ' +
101
+ 'have already seen the receipt contents, ALWAYS include `extracted` — frugr then uses your ' +
102
+ 'reading instead of running (and billing) its own AI extraction.',
98
103
  inputSchema: {
99
104
  type: 'object',
100
105
  properties: {
101
106
  filePath: {
102
107
  type: 'string',
103
108
  description: 'Absolute or ~-relative path to the receipt file on this machine.'
109
+ },
110
+ extracted: {
111
+ type: 'object',
112
+ description:
113
+ 'The fields you already read off this receipt. Preferred whenever you have seen it.',
114
+ properties: {
115
+ vendor: { type: 'string', description: 'Merchant name as printed.' },
116
+ amountCents: {
117
+ type: 'integer',
118
+ description: 'Receipt TOTAL in cents, positive (e.g. $31.03 -> 3103).'
119
+ },
120
+ date: { type: 'string', description: 'Receipt date, YYYY-MM-DD.' },
121
+ category: { type: 'string', description: 'Optional expense category suggestion.' }
122
+ },
123
+ required: ['amountCents']
104
124
  }
105
125
  },
106
126
  required: ['filePath']
@@ -132,7 +152,14 @@ async function importReceiptFile(args) {
132
152
  const data = await readFile(filePath);
133
153
  return call('tools/call', {
134
154
  name: 'propose_expense_from_receipt',
135
- arguments: { filename: basename(filePath), mimeType, dataBase64: data.toString('base64') }
155
+ arguments: {
156
+ filename: basename(filePath),
157
+ mimeType,
158
+ dataBase64: data.toString('base64'),
159
+ ...(args?.extracted && typeof args.extracted === 'object'
160
+ ? { extracted: args.extracted }
161
+ : {})
162
+ }
136
163
  });
137
164
  }
138
165
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hoagsmedia/frgur-mcp-server",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "MCP bridge to your frugr books — read tools (P&L, transactions, invoices, bills, reconciliation, time/mileage, snapshots) plus review-queue proposals incl. importing a receipt from a local file. Bring your own AI client.",
5
5
  "type": "module",
6
6
  "bin": {