Skip to main content
Glama

Categorize spending

categorize_spending
Read-only

Use this when the user pastes or lists bank or credit card transactions (date, description, amount) and asks where their money goes, to categorize spending, make a budget from them, or find subscriptions and recurring charges. Accepts a list of rows or pasted text/CSV. Returns the same report as generate_spending_report: spending by category, income vs spending, monthly totals, top merchants, recurring charges with cost per year, uncategorized merchants, Excel and PDF downloads. To correct categories, call again with the same rows and category_overrides. Use generate_spending_report when a statement file is attached. Does not connect to banks 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": {
      "transactions": "<transactions>"
    },
    "name": "categorize_spending"
  }
}

Input Schema

NameRequiredDescriptionDefault
date_orderNoOptional: order of numeric dates such as 03/04/2026: MDY (US, default) or DMY (day first). Example: DMY.
account_typeNoOptional: bank (checking or savings) or credit_card. Default: detected from the file; pasted rows count as bank. Example: credit_card.
transactionsYesThe transactions: a list like [{"date":"2026-09-02","description":"NETFLIX.COM","amount":-15.49}], or the rows pasted as text or CSV, e.g. "09/02/2026, NETFLIX.COM, -15.49". Money out negative, money in positive. Up to 20,000 rows.
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.4/5.0
Behavior4/5

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

Annotations already declare this a non-destructive, non-open-world read operation, so the description is not required to prove safety. It still adds real behavioral context beyond them: the 20,000-row ceiling, the accepted input shapes, the no-bank-connection and no-advice limits, and the fact that output mirrors generate_spending_report including Excel and PDF downloads. The only gap is that it does not say what happens to rows that fail to parse or how Uncategorized entries are surfaced beyond being correctable.

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 trigger condition is front-loaded in the first clause, and every subsequent sentence carries distinct information (input shapes, return contents, correction loop, sibling routing, limits). The return-value enumeration is the longest sentence and overlaps with the output schema, which is the only place the text 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 a five-parameter tool with full schema coverage, an output schema, and annotations, the description covers the trigger, input formats, iteration loop, sibling routing, size limits, and explicit out-of-scope behavior. Nothing an agent needs in order to select and invoke it correctly is missing.

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

Parameters3/5

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

Schema description coverage is 100%, so the baseline is 3; the schema already documents date_order, account_type, statement_year, and the full category list. The description does add one behavioral nuance the schema cannot express — that category_overrides keys are matched against "the merchant name shown in the result" and that the correction must be re-submitted with the same rows — but it adds nothing new for the other four parameters.

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?

The description pairs a specific verb and resource ("categorize spending") with the concrete triggering input (pasted or listed bank/credit card transactions with date, description, amount) and the user intents it serves. It also explicitly names the sibling generate_spending_report and the condition that separates them, so the tool is distinguishable without opening either schema.

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?

It states when to use this tool, when to use the alternative ("Use generate_spending_report when a statement file is attached"), how to iterate ("call again with the same rows and category_overrides"), and two explicit exclusions (no bank connection, no financial advice). This is a textbook when/when-not/alternatives block.

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