Skip to main content
Glama

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

TableJSON 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, at most 50 rows. Fields: date (ISO 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

TableJSON 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
    • 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"
      +}
  2. 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
  3. 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."
  4. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations only cover readOnlyHint/destructiveHint/openWorldHint; the description adds substantial context beyond them: nothing is saved in step 1, the preview expires after 15 minutes, an expired or unknown previewId never writes, duplicates are checked against the Income tab, and file size (10 MB) and edit limits (50 rows, 120-char note) are stated. The write-on-confirm behavior is consistent with destructiveHint=false since it adds rows rather than deleting.

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 the purpose, then organized as an explicit STEP 1 / STEP 2 sequence, so the density is navigable. It is long, but nearly every sentence carries operational detail (expiry, duplicate handling, which params apply to which step); a small amount of repetition about 'step 2 only' could be trimmed.

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-object, two-phase mutation tool with an output schema, the description covers the parse/confirm lifecycle, safety framing, expiry behavior, and follow-up URLs. Nothing an agent needs to call it correctly is missing, and return values are left to the output schema.

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?

Schema coverage is 100%, so the baseline is 3, but the description adds real meaning: which parameters belong to step 1 versus step 2, the consent framing for the attachment, the 50-row cap on rowEdits, and the semantics of keepBothIndexes and selectedIndexes. It goes beyond restating the schema descriptions.

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 an attached screenshot, image... or PDF') and immediately scopes it with concrete source examples (payment screenshots, wallet apps, payout/bank statements). An agent can distinguish this from siblings like add_income and add_income_from_csv purely from the first sentence.

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?

Explicitly describes the two-step flow, when to call without confirm (parse/preview only) versus with confirm: true (write), how to treat duplicates (skipped unless keepBothIndexes), and it names a sibling alternative (get_spreadsheet_url) for complex visual reviews. The when-to-use and when-not-to-use conditions are fully spelled out.

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.