Skip to main content
Glama

add_income_from_file

Import income from attached JPEG/PNG/WebP/HEIC/HEIF screenshots/images or PDF (payment/wallet/payout/bank statement; max 10 MB). Step 1: file WITHOUT confirm uses Add Income's parser and Income-tab duplicate check. Returns previewId, exact count, currency totals, rows, duplicate flags/rejections; parses only, saves nothing. Attachment is not write consent. Show rows/duplicates. Step 2: confirm:true + previewId writes only user-approved selectedIndexes/keepBothIndexes/rowEdits/tag/bulkNote. Skip flagged duplicates unless explicitly approved in keepBothIndexes. Unknown/expired previews (15 minutes) never write. Success: show spreadsheetUrl + reviewIncomeUrl. Mixed income/expense or many edits: Add Income link from get_spreadsheet_url.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "add_income_from_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
tagNoOptional client/project tag. In step 1 it pre-fills the staged rows; in step 2 it applies to the confirmed selection.
photoNoAttached image or PDF supplied by ChatGPT for step 1. The server downloads and parses the attachment securely.
confirmNoStep 2 only: true writes the staged rows. Omit it (with previewId absent) to parse and preview without writing.
bulkNoteNoStep 2 only: one note (max 120 chars) prepended to every confirmed row's Notes, same as the app's 'Add note to all entries'.
mimeTypeNoMIME type of the file (default: image/jpeg)
rowEditsNoStep 2 only: user-approved corrections, max 50 rows (date YYYY-MM-DD, source, amount, currency, category, paymentMethod, description, notes, reference, fees, taxCollected, tag).
previewIdNoStep 2 only: the previewId returned by the step-1 call.
photoBase64NoLegacy fallback for MCP clients that send complete image/PDF bytes as base64. ChatGPT should use photo.
paymentMethodNoFallback payment rail for rows where the parser found none (Cash, Check, Bank transfer, Wallet app, Credit/Debit card, Payment processor, or Other).
keepBothIndexesNoStep 2 only: preview indexes of duplicate-flagged rows the user explicitly wants to keep anyway (the app's 'Keep Both').
selectedIndexesNoStep 2 only: preview row indexes to write. Omit to write all staged rows.

Output Schema

NameRequiredDescriptionDefault
totalNo
failedNo
dedupedNo
entriesNo
messageYes
previewNo
successYes
writtenNo
warningsNo
confirmedNo
expiresAtNo
previewIdNo
duplicatesNo
entryCountNo
finalAnswerNo
unattemptedNo
rejectedRowsNo
duplicateCountNo
maxChatEntriesNo
refundRowCountNo
spreadsheetUrlNo
reviewImportUrlNo
reviewIncomeUrlNo
tooLargeForChatNo
expiresInMinutesNo
idempotentReplayNo
responseGuidanceNo
totalsByCurrencyNo
projectionTruncatedNo
confirmationContractNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / rowEdits / description
      Previous value: -"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)."New value: +"Step 2 only: user-approved corrections, max 50 rows (date YYYY-MM-DD, source, amount, currency, category, paymentMethod, description, notes, reference, fees, taxCollected, tag)."
  2. Changed4 schema fields changed
    • changedInput schema / properties / photo / properties / download_url / description
      Previous value: -"Temporary HTTPS URL supplied by ChatGPT for downloading the attachment."New value: +"ChatGPT temporary HTTPS attachment URL."
    • changedInput schema / properties / photo / properties / file_id / description
      Previous value: -"Attachment identifier supplied by ChatGPT."New value: +"ChatGPT attachment ID."
    • changedInput schema / properties / photo / properties / file_name / description
      Previous value: -"Original attachment filename supplied by ChatGPT."New value: +"ChatGPT attachment filename."
    • changedInput schema / properties / photo / properties / mime_type / description
      Previous value: -"Attachment MIME type supplied by ChatGPT."New value: +"ChatGPT attachment MIME type."
  3. Changed2 schema fields changed
    • changedInput schema / properties / rowEdits / description
      Previous value: -"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."New value: +"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)."
    • changedInput schema / properties / rowEdits / items / properties / fields / description
      Previous value: -"Only the user-approved income fields to replace on this staged row: date, source, amount, currency, category, paymentMethod, description, notes, reference, fees, taxCollected, or tag."New value: +"Only the user-approved fields to replace on this staged row (same field names as rowEdits)."
  4. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "allOf": [
      +    {
      +      "if": {
      +        "properties": {
      +          "preview": {
      +            "const": true
      +          }
      +        },
      +        "required": [
      +          "preview"
      +        ]
      +      },
      +      "then": {
      +        "required": [
      +          "previewId",
      +          "expiresAt",
      +          "entryCount",
      +          "entries",
      +          "confirmationContract"
      +        ]
      +      }
      +    },
      +    {
      +      "if": {
      +        "properties": {
      +          "confirmed": {
      +            "const": true
      +          }
      +        },
      +        "required": [
      +          "confirmed"
      +        ]
      +      },
      +      "then": {
      +        "required": [
      +          "previewId",
      +          "written",
      +          "deduped",
      +          "failed",
      +          "unattempted",
      +          "total"
      +        ]
      +      }
      +    }
      +  ],
      +  "properties": {
      +    "confirmationContract": {
      +      "type": "string"
      +    },
      +    "confirmed": {
      +      "type": "boolean"
      +    },
      +    "deduped": {
      +      "minimum": 0,
      +      "type": "integer"
      +    },
      +    "duplicateCount": {
      +      "minimum": 0,
      +      "type": "integer"
      +    },
      +    "duplicates": {
      +      "items": {
      +        "additionalProperties": true,
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "entries": {
      +      "items": {
      +        "additionalProperties": true,
      +        "properties": {
      +          "amount": {
      +            "type": "number"
      +          },
      +          "currency": {
      +            "type": "string"
      +          },
      +          "date": {
      +            "format": "date",
      +            "type": "string"
      +          },
      +          "duplicate": {
      +            "type": "boolean"
      +          },
      +          "index": {
      +            "minimum": 0,
      +            "type": "integer"
      +          },
      +          "payer": {
      +            "type": "string"
      +          }
      +        },
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "entryCount": {
      +      "minimum": 0,
      +      "type": "integer"
      +    },
      +    "expiresAt": {
      +      "format": "date-time",
      +      "type": "string"
      +    },
      +    "expiresInMinutes": {
      +      "minimum": 1,
      +      "type": "integer"
      +    },
      +    "failed": {
      +      "minimum": 0,
      +      "type": "integer"
      +    },
      +    "finalAnswer": {
      +      "type": "string"
      +    },
      +    "idempotentReplay": {
      +      "type": "boolean"
      +    },
      +    "maxChatEntries": {
      +      "minimum": 1,
      +      "type": "integer"
      +    },
      +    "message": {
      +      "type": "string"
      +    },
      +    "preview": {
      +      "type": "boolean"
      +    },
      +    "previewId": {
      +      "type": "string"
      +    },
      +    "projectionTruncated": {
      +      "type": "boolean"
      +    },
      +    "refundRowCount": {
      +      "minimum": 0,
      +      "type": "integer"
      +    },
      +    "rejectedRows": {
      +      "items": {
      +        "additionalProperties": true,
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "responseGuidance": {
      +      "type": "string"
      +    },
      +    "reviewImportUrl": {
      +      "type": "string"
      +    },
      +    "reviewIncomeUrl": {
      +      "type": "string"
      +    },
      +    "spreadsheetUrl": {
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "success": {
      +      "type": "boolean"
      +    },
      +    "tooLargeForChat": {
      +      "type": "boolean"
      +    },
      +    "total": {
      +      "minimum": 0,
      +      "type": "integer"
      +    },
      +    "totalsByCurrency": {
      +      "additionalProperties": {
      +        "type": "number"
      +      },
      +      "type": "object"
      +    },
      +    "unattempted": {
      +      "minimum": 0,
      +      "type": "integer"
      +    },
      +    "warnings": {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "written": {
      +      "minimum": 0,
      +      "type": "integer"
      +    }
      +  },
      +  "required": [
      +    "success",
      +    "message"
      +  ],
      +  "type": "object"
      +}
  5. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -{
      -  "additionalProperties": true,
      -  "description": "Standard ExpenseBot tool result envelope. `message` is the human-readable summary the AI cites; `data` is the structured payload (totals, breakdowns, ids, etc.). On failure, `success` is false and `error` carries a code/message/hint triple.",
      -  "properties": {
      -    "data": {
      -      "additionalProperties": true,
      -      "description": "Structured payload. Shape varies per tool — common keys: total, breakdown, comparison, sampleMeta, ids, expenseId, reportId, signupUrl, results.",
      -      "type": "object"
      -    },
      -    "error": {
      -      "additionalProperties": true,
      -      "description": "Present only when success === false.",
      -      "properties": {
      -        "code": {
      -          "type": "string"
      -        },
      -        "hint": {
      -          "type": "string"
      -        },
      -        "message": {
      -          "type": "string"
      -        }
      -      },
      -      "type": "object"
      -    },
      -    "message": {
      -      "description": "Human-readable result text. Always present on success; prefer rendering this verbatim before any further reasoning.",
      -      "type": "string"
      -    },
      -    "sampleMeta": {
      -      "additionalProperties": true,
      -      "description": "Set when the underlying dataset was truncated. isTruncated=true means the agent saw a sample of `sampleCount` of `totalCount` rows; aggregate totals are still accurate.",
      -      "properties": {
      -        "isTruncated": {
      -          "type": "boolean"
      -        },
      -        "sampleCount": {
      -          "type": "integer"
      -        },
      -        "totalCount": {
      -          "type": "integer"
      -        }
      -      },
      -      "type": "object"
      -    },
      -    "success": {
      -      "description": "False on tool errors; check before reading `data`.",
      -      "type": "boolean"
      -    }
      -  },
      -  "type": "object"
      -}New value: +null
  6. Changed6 schema fields changed
    • changedInput schema / properties / photo / description
      Previous value: -"Base64-encoded image/PDF bytes (step 1). On ChatGPT you may pass the attached file reference object directly; the server fetches the bytes."New value: +"Attached image or PDF supplied by ChatGPT for step 1. The server downloads and parses the attachment securely."
    • addedInput schema / properties / photo / properties
      Added value: +{
      +  "download_url": {
      +    "description": "Temporary HTTPS URL supplied by ChatGPT for downloading the attachment.",
      +    "format": "uri",
      +    "type": "string"
      +  },
      +  "file_id": {
      +    "description": "Attachment identifier supplied by ChatGPT.",
      +    "type": "string"
      +  },
      +  "file_name": {
      +    "description": "Original attachment filename supplied by ChatGPT.",
      +    "type": "string"
      +  },
      +  "mime_type": {
      +    "description": "Attachment MIME type supplied by ChatGPT.",
      +    "type": "string"
      +  }
      +}
    • addedInput schema / properties / photo / required
      Added value: +[
      +  "download_url",
      +  "file_id"
      +]
    • changedInput schema / properties / photo / type
      Previous value: -"string"New value: +"object"
    • addedInput schema / properties / photoBase64
      Added value: +{
      +  "description": "Legacy fallback for MCP clients that send complete image/PDF bytes as base64. ChatGPT should use photo.",
      +  "type": "string"
      +}
    • addedInput schema / properties / rowEdits / items / properties / fields / description
      Added value: +"Only the user-approved income fields to replace on this staged row: date, source, amount, currency, category, paymentMethod, description, notes, reference, fees, taxCollected, or tag."
  7. First observed

TDQS

A4.8/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Goes well beyond the annotations: step 1 'parses only, saves nothing', 'file WITHOUT confirm' is not write consent, duplicates are skipped unless explicitly approved via the edit field, failed/expired previews (15-minute TTL) never write, and success surfaces spreadsheetUrl + reviewIncomeUrl. These are exactly the safety and lifecycle facts the readOnlyHint/destructiveHint flags cannot convey.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with capability, then partitioned into Step 1 / Step 2 / success, which is easy to scan. It leans on telegraphic fragments ('Show rows/duplicates', 'Attachment is not write consent') that are efficient but slightly dense; almost every sentence carries distinct information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For an 11-parameter, nested-schema, two-phase migration tool this covers the full agent decision loop: preview vs write, duplicate handling, user approval scope, preview expiry, and post-success follow-up URLs. Return values are backed by an output schema, so the description need not re-document them.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 100% schema coverage the baseline is 3, and the description earns an above-baseline score by tying parameters to the two-step workflow (confirm/previewId pairing, which staged-row selectors are honored only on step 2, duplicate-approval, unknown/expired previews rejected). It does not add syntax detail for rowEdits fields or paymentMethod values beyond what the schema already lists.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Import income from attached JPEG/PNG/WebP/HEIC/HEIF screenshots/images or PDF') including accepted formats and the 10 MB cap. It is clearly distinguishable from add_income (manual entry) and add_income_from_csv (CSV path) by naming the attachment-based input and the shared 'Add Income's parser' it delegates to.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives an explicit two-step protocol: step 1 file without confirm to preview, step 2 confirm:true + previewId to write. It also names the fallback path for the edge case ('Mixed income/expense or many edits: Add Income link from get_spreadsheet_url'), so the agent knows when to route elsewhere.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.