Skip to main content
Glama
ledgerlens

ledgerlens

by vovaddk

categorize_transactions

Assigns categories to imported bank transactions using user corrections, rules, cached answers, then an LLM fallback, while preserving manual corrections.

Instructions

Categorize transactions: user corrections first, then rules, then cached LLM answers, then the LLM fallback for unknown merchants. Never overrides corrections.

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": "categorize_transactions"
  }
}

Input Schema

NameRequiredDescriptionDefault
use_llmNoAsk Claude about merchants no rule recognises.
recategorizeNoAlso redo rows that already have a category.

Output Schema

NameRequiredDescriptionDefault
warningsYes
by_sourceYesrule | llm | user_merchant | none (left uncategorized).
llm_modelYes
consideredYes
llm_merchants_sentYes
still_uncategorizedYes
uncategorized_examplesYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

Annotations only declare a non-destructive write with no open-world access, so the description carries the real burden and does it: it discloses the four-stage resolution order, that LLM answers are cached, and that corrections are immutable. It does not state that results are persisted to transaction rows or what happens to unmatched merchants when use_llm is false, which are the remaining behavioral gaps.

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

Conciseness5/5

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

Two compact sentences, front-loaded with the action and then the ordering rule; the most important constraint ('Never overrides corrections') is placed last as a short emphatic clause. No filler or redundancy.

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

Completeness4/5

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

With an output schema, full annotation coverage and a fully described parameter schema, the description only needs to explain the processing pipeline, which it does. Slightly incomplete on the mutation side: it never says categories are written back or what the cost behaviour of the LLM stage is, but nothing essential for correct invocation 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% and both parameters are already documented in the schema, so the baseline is 3. The description adds some linkage by describing the 'LLM fallback' and 'cached LLM answers' stages that use_llm toggles, and by implying recategorize will still not override corrections, but it does not elaborate beyond that.

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 ('Categorize transactions') and then defines the exact resolution pipeline: user corrections, rules, cached LLM answers, LLM fallback. The precedence order lets an agent distinguish it from a single-row 'set_category' style sibling 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 Guidelines4/5

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

The precedence chain plus 'Never overrides corrections' makes clear when this tool applies and what it will not touch, which is the key usage constraint for a bulk categorization run. It stops short of naming alternatives (e.g. set_category for a single manual override) or stating when not to call it at all, so it is clear context without explicit exclusions.

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