Skip to main content
Glama
Personal Expense Categorizer

Personal Expense Categorizer

by alihabbache

add_category_rule

Idempotent

Add a keyword-to-category rule so matching transaction descriptions are categorized automatically; the rule saves locally and applies on the next categorization call.

Instructions

Teach the categorizer: transactions whose description contains the keyword will be assigned the category. Saved to the user's local rules file and applied on the next call. Only call after the user has confirmed the mapping.

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": {
      "keyword": "<keyword>",
      "category": "<category>"
    },
    "name": "add_category_rule"
  }
}

Input Schema

NameRequiredDescriptionDefault
kindNoOnly needed when creating a new category (default expense).
keywordYesMerchant text to match, e.g. 'blue bottle'. Case and punctuation are ignored.
categoryYesCategory name, e.g. 'Dining'. A new name creates a new category.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare the mutation/idempotency profile, and the description adds real value on top: persistence to the user's local rules file, deferred application on the next call, and a user-confirmation requirement. It doesn't say what happens if a rule for the same keyword already exists, which is the one behavioral gap.

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 short sentences, front-loaded with the operation and its matching semantics, followed by persistence and the confirmation constraint. No filler or repetition.

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?

For a three-parameter mutation tool with no output schema and full annotation coverage, the description supplies matching behavior, storage location, effect timing, and consent requirements. The only missing piece is duplicate-rule behavior, which is partially implied by the idempotency annotation.

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 baseline is 3. The description clarifies that matching is substring containment on the transaction description, a small addition beyond the schema's 'Merchant text to match', but adds nothing about the optional 'kind' parameter that the schema does not already say.

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?

States a specific verb and resource — teaching the categorizer a keyword-to-category mapping — and explains the matching rule (description contains keyword). It is distinguishable from categorize_transactions by being a rule-persistence operation, but no sibling is named explicitly.

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?

'Only call after the user has confirmed the mapping' gives a concrete precondition, and 'applied on the next call' tells the agent when the effect takes hold. It stops short of naming an alternative tool for one-off categorization, so the when-not guidance is only implied.

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