create_transaction_rule, update_transaction_rule, delete_transaction_rule, batch_create_rules, and apply_rules.
list_transaction_rules
Lists transaction rules with optional filters. Agents should always call this before creating new rules to avoid duplicates. Returns each rule’s actions, trigger, priority, hit count, and last-hit timestamp — useful for spotting stale or never-matching rules. Scope: Read Mirrors:GET /api/v1/rules
Parameters
Filter to rules that set this category.
true for only enabled, false for only disabled, omit for both.Search by rule name. Comma-separated values are ORed.
contains, words, or fuzzy.Max 500.
Pagination cursor.
Optional session ID.
Optional rationale.
Example input
Example output
preview_rule
Dry-run a condition tree against existing transactions — no writes, no hit-count bump. Returns the match count, total scanned, and a sample of matching transactions. Agents use this to test a condition before committing to a rule. Scope: ReadParameters
Condition tree. Same grammar as
create_transaction_rule.conditions. Leaf: {"field":"...","op":"...","value":...}. Combinators: {"and":[...]}, {"or":[...]}, {"not":{...}}.Number of sample matching transactions to return. Max 50. The
match_count reflects the full match set regardless of sample size.Optional session ID.
Optional rationale.
Example input
Example output
Condition grammar
Full DSL is in the Breadbox repo’sdocs/rule-dsl.md. Short form:
- Fields —
name,merchant_name,amount,category_primary,category_detailed,category(the assigned slug, live-updated by earlier-stage rules),pending,provider,account_id,account_name,user_id,user_name,tags. - Operators —
- String/category:
eq,neq,contains,not_contains,matches(RE2),in. - Numeric:
eq,neq,gt,gte,lt,lte. - Bool:
eq,neq. - Tags:
contains,not_contains,in.
- String/category:
- Combinators —
and,or,not(nest freely, max depth 10).
{} (or omit conditions entirely on rule creation) to match every transaction.