Documentation

apply_pattern

apply_pattern MCP tool reference, parameters, return type, and safety hints.

npm

What it does

Recategorizes transactions that match a description pattern, optionally saving the pattern as a rule.

Signature(pattern: string, target_account: string, force?: boolean, persist_rule?: boolean, dry_run?: boolean, source_account?: string | null, date_from?: string | null, date_to?: string | null) => Record<string, unknown>
can writedry-run

Can write, but supports dry-run. Ask the agent to preview the result before committing changes.

When to use it

Use this section to decide whether the tool fits the user request before calling it.

Use it when an agent needs to prepare a change and show a preview before committing it.

Before calling

Agents should gather these facts or confirmations first.

1

Have exact values for required inputs: pattern, target_account.

2

Start with dry_run=true, show the preview, then ask before applying the change.

3

State the intended ledger change in plain language before calling the tool.

Parameters

Required inputs are marked clearly. Optional inputs can usually be omitted unless the workflow needs them.

patternrequired
string

Text or regular-expression pattern used to match descriptions.

target_accountrequired
string

Target category or account for the matched rows.

forceoptional
boolean

Allows the operation to continue through conflicts that would otherwise stop it.

Default: false
persist_ruleoptional
boolean

Saves the pattern as a future match rule.

Default: false
dry_runoptional
boolean

Preview the result without committing changes.

Default: true
source_accountoptional
string | null

Optional source account filter.

Default: null
date_fromoptional
string | null

Start date filter in YYYY-MM-DD format.

Default: null
date_tooptional
string | null

End date filter in YYYY-MM-DD format.

Default: null

Agent call shape

Use the exact tool name and pass arguments as structured JSON through the MCP client.

apply_pattern

Copy this shape into agent instructions, evals, or MCP client tests.

{
  "tool": "apply_pattern",
  "arguments": {
    "pattern": "<pattern>",
    "target_account": "<target_account>",
    "dry_run": true
  }
}

Metadata