Skip to main content
Glama

Lovie Company Formation

Preview Categorization Rule

transaction_preview_categorization_rule
Read-only

Count how many existing transactions a categorization rule would match, without writing anything, and list the live rules it collides with: a duplicate, a rule that shadows it or that it would shadow, an overlap booking a different account, or a redundant rule booking the same one — each with how many of the last twelve months' transactions both match and how many this rule would take from the other. Use this to check a rule before creating or applying it. The rule does not have to exist yet.

Input Schema

NameRequiredDescriptionDefault
ruleYes

Output Schema

NameRequiredDescriptionDefault
conflictsNo
splitPreviewNo
matchingCountNo
ruleHeldCountNo
closedMonthCountNo
personBookedCountNo
sampleTransactionsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedInput schema / properties / rule / properties / category
      Added value: +{
      +  "properties": {
      +    "key": {
      +      "description": "Lowercase kebab-case code identifier.",
      +      "properties": {
      +        "value": {
      +          "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$",
      +          "type": "string"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "ownerKey": {
      +      "maxLength": 100,
      +      "pattern": "^[a-z0-9_-]*$",
      +      "type": "string"
      +    },
      +    "ownerType": {
      +      "enum": [
      +        "OWNER_TYPE_SYSTEM",
      +        "OWNER_TYPE_COMPANY",
      +        "OWNER_TYPE_INTEGRATION"
      +      ],
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "key"
      +  ],
      +  "type": "object"
      +}
    • changedInput schema / properties / rule / properties / splitLines / items / properties / glAccountPath / pattern
      Previous value: -"^[a-z0-9]+(-[a-z0-9]+)*(/[a-z0-9]+(-[a-z0-9]+)*)*$"New value: +"^([a-z0-9]+(-[a-z0-9]+)*(/[a-z0-9]+(-[a-z0-9]+)*)*)?$"
  2. Changed29 schema fields changed
    • addedInput schema / properties / rule / properties / actionType
      Added value: +{
      +  "enum": [
      +    "RULE_ACTION_TYPE_UNSPECIFIED",
      +    "RULE_ACTION_TYPE_BOOK",
      +    "RULE_ACTION_TYPE_EXCLUDE",
      +    "RULE_ACTION_TYPE_SPLIT"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / rule / properties / actions
      Added value: +{
      +  "items": {
      +    "properties": {
      +      "fieldCode": {
      +        "maxLength": 100,
      +        "minLength": 1,
      +        "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$",
      +        "type": "string"
      +      },
      +      "optionPath": {
      +        "maxLength": 255,
      +        "minLength": 1,
      +        "pattern": "^[a-z0-9]+(-[a-z0-9]+)*(/[a-z0-9]+(-[a-z0-9]+)*)*$",
      +        "type": "string"
      +      },
      +      "target": {
      +        "enum": [
      +          "RULE_ACTION_TARGET_COUNTERPARTY",
      +          "RULE_ACTION_TARGET_TRANSACTION"
      +        ],
      +        "type": "string"
      +      }
      +    },
      +    "type": "object"
      +  },
      +  "maxItems": 10,
      +  "type": "array"
      +}
    • addedInput schema / properties / rule / properties / appliedCount
      Added value: +{
      +  "type": "integer"
      +}
    • addedInput schema / properties / rule / properties / appliedThisMonth
      Added value: +{
      +  "type": "integer"
      +}
    • addedInput schema / properties / rule / properties / approvedAt
      Added value: +{
      +  "format": "date-time",
      +  "type": "string"
      +}
    • addedInput schema / properties / rule / properties / approvedBy
      Added value: +{
      +  "description": "UUID value wrapper.",
      +  "properties": {
      +    "value": {
      +      "format": "uuid",
      +      "type": "string"
      +    }
      +  },
      +  "type": "object"
      +}
    • addedInput schema / properties / rule / properties / autoPostConsentedAt
      Added value: +{
      +  "format": "date-time",
      +  "type": "string"
      +}
    • addedInput schema / properties / rule / properties / autoPostMaxAmount
      Added value: +{
      +  "maxLength": 30,
      +  "pattern": "^([0-9]+(\\.[0-9]{1,4})?)?$",
      +  "type": "string"
      +}
    • addedInput schema / properties / rule / properties / cleanBookingsInWindow
      Added value: +{
      +  "type": "integer"
      +}
    • addedInput schema / properties / rule / properties / conditions
      Added value: +{
      +  "items": {
      +    "properties": {
      +      "amountMax": {
      +        "maxLength": 30,
      +        "pattern": "^([0-9]+(\\.[0-9]{1,4})?)?$",
      +        "type": "string"
      +      },
      +      "amountMin": {
      +        "maxLength": 30,
      +        "pattern": "^([0-9]+(\\.[0-9]{1,4})?)?$",
      +        "type": "string"
      +      },
      +      "group": {
      +        "maximum": 19,
      +        "minimum": 0,
      +        "type": "integer"
      +      },
      +      "kind": {
      +        "enum": [
      +          "RULE_CONDITION_KIND_COUNTERPARTY",
      +          "RULE_CONDITION_KIND_NAME_CONTAINS",
      +          "RULE_CONDITION_KIND_DESCRIPTOR_REGEX",
      +          "RULE_CONDITION_KIND_MERCHANT_REGEX",
      +          "RULE_CONDITION_KIND_MCC",
      +          "RULE_CONDITION_KIND_PROVIDER",
      +          "RULE_CONDITION_KIND_ACCOUNT_ID",
      +          "RULE_CONDITION_KIND_CURRENCY",
      +          "RULE_CONDITION_KIND_AMOUNT_RANGE",
      +          "RULE_CONDITION_KIND_DIRECTION",
      +          "RULE_CONDITION_KIND_CARD",
      +          "RULE_CONDITION_KIND_TEAM_MEMBER",
      +          "RULE_CONDITION_KIND_CATEGORY",
      +          "RULE_CONDITION_KIND_ALL"
      +        ],
      +        "type": "string"
      +      },
      +      "negate": {
      +        "type": "boolean"
      +      },
      +      "reviewStatus": {
      +        "enum": [
      +          "RULE_CONDITION_REVIEW_STATUS_UNSPECIFIED",
      +          "RULE_CONDITION_REVIEW_STATUS_APPROVED",
      +          "RULE_CONDITION_REVIEW_STATUS_IN_REVIEW"
      +        ],
      +        "type": "string"
      +      },
      +      "textValue": {
      +        "maxLength": 500,
      +        "type": "string"
      +      },
      +      "uuidValue": {
      +        "maxLength": 36,
      +        "pattern": "^([0-9a-fA-F-]{36})?$",
      +        "type": "string"
      +      }
      +    },
      +    "type": "object"
      +  },
      +  "maxItems": 100,
      +  "type": "array"
      +}
    • addedInput schema / properties / rule / properties / correctionCount
      Added value: +{
      +  "type": "integer"
      +}
    • addedInput schema / properties / rule / properties / dead
      Added value: +{
      +  "type": "boolean"
      +}
    • removedInput schema / properties / rule / properties / glAccountPath / minLength
      Removed value: -1
    • changedInput schema / properties / rule / properties / glAccountPath / pattern
      Previous value: -"^[a-z0-9]+(-[a-z0-9]+)*(/[a-z0-9]+(-[a-z0-9]+)*)*$"New value: +"^([a-z0-9]+(-[a-z0-9]+)*(/[a-z0-9]+(-[a-z0-9]+)*)*)?$"
    • addedInput schema / properties / rule / properties / lastAppliedAt
      Added value: +{
      +  "format": "date-time",
      +  "type": "string"
      +}
    • addedInput schema / properties / rule / properties / origin
      Added value: +{
      +  "enum": [
      +    "RULE_ORIGIN_UNSPECIFIED",
      +    "RULE_ORIGIN_USER",
      +    "RULE_ORIGIN_AI",
      +    "RULE_ORIGIN_PLATFORM",
      +    "RULE_ORIGIN_HABIT"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / rule / properties / posting
      Added value: +{
      +  "enum": [
      +    "RULE_POSTING_UNSPECIFIED",
      +    "RULE_POSTING_REVIEW",
      +    "RULE_POSTING_AUTO_POST"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / rule / properties / proposalId
      Added value: +{
      +  "description": "UUID value wrapper.",
      +  "properties": {
      +    "value": {
      +      "format": "uuid",
      +      "type": "string"
      +    }
      +  },
      +  "type": "object"
      +}
    • addedInput schema / properties / rule / properties / ruleCode
      Added value: +{
      +  "maxLength": 255,
      +  "type": "string"
      +}
    • addedInput schema / properties / rule / properties / splitLines
      Added value: +{
      +  "items": {
      +    "properties": {
      +      "glAccountPath": {
      +        "maxLength": 200,
      +        "minLength": 1,
      +        "pattern": "^[a-z0-9]+(-[a-z0-9]+)*(/[a-z0-9]+(-[a-z0-9]+)*)*$",
      +        "type": "string"
      +      },
      +      "isRemainder": {
      +        "type": "boolean"
      +      },
      +      "position": {
      +        "type": "integer"
      +      },
      +      "splitAmount": {
      +        "maxLength": 30,
      +        "pattern": "^([0-9]+(\\.[0-9]{1,4})?)?$",
      +        "type": "string"
      +      },
      +      "splitPercent": {
      +        "maxLength": 12,
      +        "pattern": "^([0-9]+(\\.[0-9]{1,4})?)?$",
      +        "type": "string"
      +      }
      +    },
      +    "type": "object"
      +  },
      +  "maxItems": 20,
      +  "type": "array"
      +}
    • addedInput schema / properties / rule / properties / status
      Added value: +{
      +  "enum": [
      +    "RULE_STATUS_UNSPECIFIED",
      +    "RULE_STATUS_DRAFT",
      +    "RULE_STATUS_ACTIVE",
      +    "RULE_STATUS_PAUSED",
      +    "RULE_STATUS_SUPERSEDED",
      +    "RULE_STATUS_REJECTED"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / rule / properties / trackRecordWindow
      Added value: +{
      +  "type": "integer"
      +}
    • addedInput schema / properties / rule / properties / version
      Added value: +{
      +  "type": "integer"
      +}
    • addedOutput schema / properties / closedMonthCount
      Added value: +{
      +  "type": "integer"
      +}
    • addedOutput schema / properties / conflicts
      Added value: +{
      +  "items": {
      +    "properties": {
      +      "kind": {
      +        "enum": [
      +          "RULE_CONFLICT_KIND_UNSPECIFIED",
      +          "RULE_CONFLICT_KIND_DUPLICATE",
      +          "RULE_CONFLICT_KIND_SHADOWED",
      +          "RULE_CONFLICT_KIND_OVERLAP",
      +          "RULE_CONFLICT_KIND_REDUNDANT",
      +          "RULE_CONFLICT_KIND_CATCH_ALL"
      +        ],
      +        "type": "string"
      +      },
      +      "overlapCount": {
      +        "type": "integer"
      +      },
      +      "previewedRuleFirst": {
      +        "type": "boolean"
      +      },
      +      "ruleCode": {
      +        "type": "string"
      +      },
      +      "ruleId": {
      +        "anyOf": [
      +          {
      +            "description": "UUID value wrapper.",
      +            "properties": {
      +              "value": {
      +                "format": "uuid",
      +                "type": "string"
      +              }
      +            },
      +            "type": "object"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ]
      +      },
      +      "ruleName": {
      +        "anyOf": [
      +          {
      +            "description": "Human-readable name (1-255 Unicode chars).",
      +            "properties": {
      +              "value": {
      +                "maxLength": 255,
      +                "minLength": 1,
      +                "type": "string"
      +              }
      +            },
      +            "type": "object"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ]
      +      },
      +      "takenCount": {
      +        "type": "integer"
      +      }
      +    },
      +    "type": "object"
      +  },
      +  "type": "array"
      +}
    • addedOutput schema / properties / personBookedCount
      Added value: +{
      +  "type": "integer"
      +}
    • addedOutput schema / properties / ruleHeldCount
      Added value: +{
      +  "type": "integer"
      +}
    • addedOutput schema / properties / sampleTransactions
      Added value: +{
      +  "items": {
      +    "properties": {
      +      "amount": {
      +        "type": "string"
      +      },
      +      "currencyCode": {
      +        "type": "string"
      +      },
      +      "date": {
      +        "type": "string"
      +      },
      +      "descriptorText": {
      +        "type": "string"
      +      },
      +      "id": {
      +        "anyOf": [
      +          {
      +            "description": "UUID value wrapper.",
      +            "properties": {
      +              "value": {
      +                "format": "uuid",
      +                "type": "string"
      +              }
      +            },
      +            "type": "object"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ]
      +      }
      +    },
      +    "type": "object"
      +  },
      +  "type": "array"
      +}
    • addedOutput schema / properties / splitPreview
      Added value: +{
      +  "anyOf": [
      +    {
      +      "properties": {
      +        "exampleAmount": {
      +          "type": "string"
      +        },
      +        "exampleTransactionId": {
      +          "anyOf": [
      +            {
      +              "description": "UUID value wrapper.",
      +              "properties": {
      +                "value": {
      +                  "format": "uuid",
      +                  "type": "string"
      +                }
      +              },
      +              "type": "object"
      +            },
      +            {
      +              "type": "null"
      +            }
      +          ]
      +        },
      +        "lines": {
      +          "items": {
      +            "properties": {
      +              "exampleAmount": {
      +                "type": "string"
      +              },
      +              "glAccountPath": {
      +                "type": "string"
      +              },
      +              "isRemainder": {
      +                "type": "boolean"
      +              },
      +              "splitAmount": {
      +                "type": "string"
      +              },
      +              "splitPercent": {
      +                "type": "string"
      +              }
      +            },
      +            "type": "object"
      +          },
      +          "type": "array"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ]
      +}
  3. Added

TDQS

A4.1/5.0
Behavior5/5

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

The description adds substantial context beyond readOnlyHint=true and destructiveHint=false: it specifies the twelve-month counting window, enumerates collision types, and explains how counts are provided for overlaps. It also reinforces the no-write behavior.

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 definition is front-loaded with the main action and stays focused on relevant preview semantics. The first sentence is dense with a long collision-type list, but the content is purposeful rather than padded.

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?

An output schema exists, so return values need not be explained, and annotations cover the read-only safety profile. The description is strong on behavior and collision semantics but does not fully bridge the complex input schema's lack of field descriptions.

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

Parameters2/5

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

Schema description coverage is 0% and the single parameter is a complex nested rule object. The description does not explain required fields like companyId/name, condition structure, or which rule attributes drive matching, though it does add the useful semantic that the rule need not already exist.

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 states specific verbs and resource: count matching transactions for a categorization rule and list colliding live rules. It clearly differentiates this preview from merely getting or listing rules by emphasizing collision preview before creation/application.

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 explicitly says to use this to check a rule before creating or applying it, and clarifies that the rule does not have to exist yet. It does not name alternatives such as transaction_get_categorization_rule or transaction_run_shadow_comparison, so it falls short of full when/when-not routing.

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.