add_income_from_file
Import income from an attached screenshot, image (JPEG, PNG, WebP, HEIC/HEIF), or PDF (payment screenshots, wallet apps, payout or bank statements; max 10 MB). This is a two-step tool. STEP 1: call it with the file and WITHOUT confirm — ExpenseBot parses the file with the same importer as the app's Add Income screen, checks every row against the user's Income tab for duplicates, and returns a preview with a previewId, exact row count, totals by currency, per-row details, duplicate flags, and any rejected rows. NOTHING is saved in step 1; treat the attachment as consent to parse, not consent to write. Show the user the parsed rows and duplicates, then STEP 2: call again with confirm: true and the previewId to write exactly those rows. Only include user-approved changes in step 2 (selectedIndexes, keepBothIndexes, rowEdits, tag, bulkNote). Flagged duplicates are skipped unless the user explicitly asks to keep them (keepBothIndexes). The preview expires after 15 minutes; an expired or unknown previewId never writes. After a successful confirm, show the returned spreadsheetUrl and reviewIncomeUrl. For a visually complex review (mixed income/expense rows, many edits), send the user to the Add Income app link returned by get_spreadsheet_url instead.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tag | No | Optional client/project tag. In step 1 it pre-fills the staged rows; in step 2 it applies to the confirmed selection. | |
| photo | No | Attached image or PDF supplied by ChatGPT for step 1. The server downloads and parses the attachment securely. | |
| confirm | No | Step 2 only: true writes the staged rows. Omit it (with previewId absent) to parse and preview without writing. | |
| bulkNote | No | Step 2 only: one note (max 120 chars) prepended to every confirmed row's Notes, same as the app's 'Add note to all entries'. | |
| mimeType | No | MIME type of the file (default: image/jpeg) | |
| rowEdits | No | Step 2 only: user-approved corrections, at most 50 rows. Fields: date (ISO YYYY-MM-DD), source, amount, currency, category, paymentMethod, description, notes, reference, fees, taxCollected, tag. | |
| previewId | No | Step 2 only: the previewId returned by the step-1 call. | |
| photoBase64 | No | Legacy fallback for MCP clients that send complete image/PDF bytes as base64. ChatGPT should use photo. | |
| paymentMethod | No | Fallback payment rail for rows where the parser found none (Cash, Check, Bank transfer, Wallet app, Credit/Debit card, Payment processor, or Other). | |
| keepBothIndexes | No | Step 2 only: preview indexes of duplicate-flagged rows the user explicitly wants to keep anyway (the app's 'Keep Both'). | |
| selectedIndexes | No | Step 2 only: preview row indexes to write. Omit to write all staged rows. |