Skip to main content
Glama

Generate spending report

generate_spending_report
Read-only

Use this when the user attaches a bank or credit card statement (text PDF, CSV or Excel export) and asks to turn it into a budget, see where their money goes, find subscriptions or recurring charges, or total spending by category or month. Returns spending by category, income vs spending and net, monthly totals, top merchants, recurring charges with next expected date and cost per year, a list of uncategorized merchants, an Excel workbook and a one-page PDF summary. Transfers between own accounts and credit card payments are not counted as spending. To correct categories, call again with the same file and category_overrides. Does not connect to banks, does not read scanned images (needs OCR first), and does not give financial advice.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "file": "<file>"
    },
    "name": "generate_spending_report"
  }
}

Input Schema

NameRequiredDescriptionDefault
fileYesThe bank or credit card statement: a text PDF from the bank's website, or the CSV or Excel (.xlsx) transaction export, e.g. september-statement.pdf.
date_orderNoOptional: order of numeric dates such as 03/04/2026: MDY (US, default) or DMY (day first). Example: DMY.
flip_signsNoOptional, CSV/Excel only: true when the export lists purchases as positive numbers and payments as negative (some card exports). Default false.
account_typeNoOptional: bank (checking or savings) or credit_card. Default: detected from the file; pasted rows count as bank. Example: credit_card.
statement_yearNoOptional: the year for dates printed without one, e.g. 2026.
category_overridesNoOptional: your category for merchants the rules got wrong or left Uncategorized, keyed by the merchant name shown in the result. Example: {"Blue Bottle":"Dining","Riverbend Design":"Income","Venmo":"Transfers"}. Also accepts "Blue Bottle=Dining; Acme=Income". Categories: Groceries, Dining, Transport, Travel, Shopping, Subscriptions, Utilities, Rent & mortgage, Health, Insurance, Entertainment, Cash & ATM, Fees & interest, Payments to people, Income, Transfers (not counted), or a new name such as Pets.

Output Schema

NameRequiredDescriptionDefault
rulesYes
monthsYes
sourceYes
totalsYes
headlineYes
warningsYes
downloadsYes
recurringYes
categoriesYes
top_merchantsYes
uncategorizedYes
overrides_appliedYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.3/5.0
Behavior5/5

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

Annotations declare readOnlyHint=true and destructiveHint=false, but the description goes well beyond them: it explains the accounting rule that transfers between own accounts and credit card payments are excluded from spending, the exact deliverables (Excel workbook, one-page PDF, recurring charges with next expected date and annual cost), and the correction loop via category_overrides. Those are behavioral facts an agent cannot recover from the annotations or schema.

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?

The paragraph is dense but front-loaded: trigger conditions first, then outputs, then accounting rules, then limits. Every sentence carries information and none is a restatement of the name. It is one unbroken block, however, and the module deliverable listing could be tightened without loss.

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 a six-parameter tool with nested file objects and an output schema, the description covers inputs' intent, the counting rules that shape results, the deliverable artifacts, and the correction path. An agent could call this correctly and explain the output without opening anything else.

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; the description earns above that by adding workflow semantics the schema does not convey — that category_overrides is applied by re-submitting the same file, and that overrides are keyed by the merchant names shown in the result (including Uncategorized). It still leaves date_order, flip_signs, account_type, and statement_year entirely to the schema.

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

Purpose4/5

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

The description gives a specific verb and resource plus concrete trigger scenarios (budgeting, subscription detection, spending by category/month) and states clearly that it produces a report rather than just categorizing. It implies its own re-invocation for corrections, which distinguishes it functionally from categorize_spending, but it never names that sibling, so an agent still has to infer which of the two to pick.

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

Usage Guidelines4/5

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

It opens with an explicit when-to-use condition (user attaches a bank/credit card statement and asks for budget, category totals, or recurring charges) and closes with explicit exclusions (no bank connection, no scanned images without OCR, no financial advice). What is missing is only the routing to the sibling categorize_spending — the description never says when that alternative is preferable over passing category_overrides here.

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.

Resources