Skip to main content
Glama
Beankeeper

Beankeeper

Official

rule_create

Create transaction categorization rules that route bank lines to an account when conditions like description, direction, amount, or counterparty match, with optional project and counterparty assignment.

Instructions

Create a categorization rule that fires when all of its conditions hold: contains (case-insensitive description substring), direction (inflow or outflow), amount_eq, amount_gt or amount_lt in major units, and counterparty. Give at least one. A counterparty condition uses the transaction's link, or else the counterparty's name as whole words of the description, without case or accents; a name with no word of three or more letters or digits matches only by link and returns warnings. When it fires it routes the line to account, and can link set_counterparty and attribute set_project; writing either action needs counterparty_associate and project_split access. Higher priority wins. Omitted priority defaults to zero.

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": {
      "company": "<company>",
      "account": "<account>"
    },
    "name": "rule_create"
  }
}

Input Schema

NameRequiredDescriptionDefault
accountYesAccount that receives each categorized line.
companyYes
containsNoCondition: case-insensitive literal substring of the description.
currencyNoCurrency of the amount condition. Defaults to the book's currency.
priorityNoThe precedence of a rule. Higher values take precedence.
amount_eqNoCondition: exact line amount in major units.
amount_gtNoCondition: line amount greater than this, in major units.
amount_ltNoCondition: line amount less than this, in major units.
directionNoCondition: inflow when money arrived in the bank account, outflow when it left.
set_projectNoAction: attribute each categorized line to this project.
counterpartyNoCondition: the line is from or to this counterparty. A linked counterparty decides; otherwise the party's name must appear in the description.
set_counterpartyNoAction: link each categorized transaction to this counterparty.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed12 schema fields changedv1.2.0
    • addedInput schema / properties / account / description
      Added value: +"Account that receives each categorized line."
    • addedInput schema / properties / amount_eq
      Added value: +{
      +  "description": "Condition: exact line amount in major units.",
      +  "pattern": "^[+-]?[0-9]+(\\.[0-9]*)?$",
      +  "type": [
      +    "string",
      +    "null"
      +  ]
      +}
    • addedInput schema / properties / amount_gt
      Added value: +{
      +  "description": "Condition: line amount greater than this, in major units.",
      +  "pattern": "^[+-]?[0-9]+(\\.[0-9]*)?$",
      +  "type": [
      +    "string",
      +    "null"
      +  ]
      +}
    • addedInput schema / properties / amount_lt
      Added value: +{
      +  "description": "Condition: line amount less than this, in major units.",
      +  "pattern": "^[+-]?[0-9]+(\\.[0-9]*)?$",
      +  "type": [
      +    "string",
      +    "null"
      +  ]
      +}
    • addedInput schema / properties / contains / description
      Added value: +"Condition: case-insensitive literal substring of the description."
    • changedInput schema / properties / contains / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "null"
      +]
    • addedInput schema / properties / counterparty
      Added value: +{
      +  "description": "Condition: the line is from or to this counterparty. A linked counterparty\ndecides; otherwise the party's name must appear in the description.",
      +  "type": [
      +    "string",
      +    "null"
      +  ]
      +}
    • addedInput schema / properties / currency
      Added value: +{
      +  "default": null,
      +  "description": "Currency of the amount condition. Defaults to the book's currency.",
      +  "type": [
      +    "string",
      +    "null"
      +  ]
      +}
    • addedInput schema / properties / direction
      Added value: +{
      +  "anyOf": [
      +    {
      +      "description": "Which way money moved through the bank or card account.",
      +      "oneOf": [
      +        {
      +          "const": "inflow",
      +          "description": "Money arrived: the bank line is a debit and the categorized line a credit.",
      +          "type": "string"
      +        },
      +        {
      +          "const": "outflow",
      +          "description": "Money left: the bank line is a credit and the categorized line a debit.",
      +          "type": "string"
      +        }
      +      ]
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "description": "Condition: inflow when money arrived in the bank account, outflow when it left."
      +}
    • addedInput schema / properties / set_counterparty
      Added value: +{
      +  "description": "Action: link each categorized transaction to this counterparty.",
      +  "type": [
      +    "string",
      +    "null"
      +  ]
      +}
    • addedInput schema / properties / set_project
      Added value: +{
      +  "description": "Action: attribute each categorized line to this project.",
      +  "type": [
      +    "string",
      +    "null"
      +  ]
      +}
    • changedInput schema / required
      Previous value: -[
      -  "company",
      -  "contains",
      -  "account"
      -]New value: +[
      +  "company",
      +  "account"
      +]
  2. First observedv1.1.0

TDQS

A4/5.0
Behavior4/5

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

Annotations only declare readOnlyHint=false; the description carries the behavioral burden well, disclosing matching semantics (case-insensitive substring, whole-word/no-accent, 3+ letter rule), that certain names 'returns warnings', access requirements, and that higher priority wins with zero default. Rich, but doesn't describe success/return behavior or duplicate-rule handling.

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?

Dense and front-loaded with the core action and condition semantics first. It is a long single paragraph with some run-on density, but nearly every clause carries information, so little is wasted.

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 12-parameter mutation tool with no output schema and minimal annotations, the description covers conditions, actions, access prerequisites, precedence, and edge-case warnings thoroughly. It could state what a successful call returns, but the core calling behavior is well covered.

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 high (92%), so baseline is 3, but the description adds real meaning beyond the schema: counterparty matching via link-or-name with whole-word/accent rules and warnings, action-to-access mapping, and default priority of zero. This meaningfully complements the schema fields.

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: 'Create a categorization rule that fires when all of its conditions hold', then details conditions and actions. Very clear what it does, though it never explicitly contrasts with siblings like rule_amend or rule_apply to help selection.

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?

Provides strong usage constraints: 'Give at least one' condition, prerequisites ('writing either action needs counterparty_associate and project_split access'), and firing/precedence semantics. Missing only explicit when-to-use-vs-alternative routing (e.g., amend vs create).

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

Deploy Server

Other Tools