Skip to main content
Glama
Beankeeper

Beankeeper

Official

txn_import

Import balanced JSON journals into one company as an atomic batch. Validate with dry-run and skip or reject duplicate references for safe retries.

Instructions

Import balanced JSON journals into one company in an atomic batch. Requires Direct posting authority. Supply 1 to 500 transactions, up to 5000 total entries and 1 MiB of JSON. Amounts are in major units. Use stable source references for retries; a reference must not start with the reserved txn: prefix (any case), which links use for transaction IDs. Use dry_run=true to validate and roll back. The default duplicate policy is skip. Set project on a revenue or expense entry to record its full amount as a project split in the same batch. Results list each new transaction's entry IDs. A skipped duplicate records no split; its project_attribution reports whether each requested line is already attributed and names the transaction and entry to pass to project_split. For bank-statement CSV, OFX or QFX, use ledger_setup_statement_import.

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>",
      "transactions": "<transactions>"
    },
    "name": "txn_import"
  }
}

Input Schema

NameRequiredDescriptionDefault
companyYes
dry_runNoRun the posting checks and roll back all mutations.
currencyNoDefault currency for journals without a currency. Defaults to `BEANKEEPER_CURRENCY` or USD.
on_conflictNoSkip duplicate references (default) or reject the whole batch.
transactionsYesBalanced journals in the same format as the CLI JSON import.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv1.2.0
    • addedInput schema / properties / transactions / items / properties / entries / items / properties / billable
      Added value: +{
      +  "anyOf": [
      +    {
      +      "description": "Whether this cost or work is intended for a customer invoice.",
      +      "oneOf": [
      +        {
      +          "const": "internal",
      +          "description": "Counts as work or cost without entering a customer invoice.",
      +          "type": "string"
      +        },
      +        {
      +          "const": "billable",
      +          "description": "May be included in an invoice to the project customer.",
      +          "type": "string"
      +        }
      +      ]
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "description": "Billable state of the project split. Defaults to internal."
      +}
    • addedInput schema / properties / transactions / items / properties / entries / items / properties / project
      Added value: +{
      +  "description": "Project receiving the full amount of this revenue or expense line,\nrecorded in the same atomic import.",
      +  "type": [
      +    "string",
      +    "null"
      +  ]
      +}
  2. First observedv1.1.0

TDQS

A4.5/5.0
Behavior3/5

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

Annotations only declare readOnlyHint=false, so the description carries most of the burden and delivers: Direct posting authority requirement, atomicity, size/count limits, retry-reference reservation, duplicate-skip semantics, and what a skipped duplicate reports. However, the bonus context is strong enough that this would score higher than 3 if not for one gap — the description doesn't state anything about failure behavior of a partial batch beyond dry_run, nor response shape beyond entry IDs. Actually the description is unusually rich for a mutation tool, so 4 is warranted.

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?

Front-loaded with purpose, then constraints, then the alternative tool — a sensible ordering with no filler sentences. It is dense and the project_attribution sentence is intricate, but nearly every clause carries decision-relevant information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

There is no output schema, and the description compensates by describing results (each new transaction's entry IDs) and the project_attribution payload including the transaction and entry needed for project_split. Given the nested payload and 80% schema coverage, an agent has what it needs to call this correctly.

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

Parameters5/5

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

Schema coverage is already 80%, yet the description still adds real meaning: amounts are in major units, references must not start with the reserved 'txn:' prefix (any case), on_conflict default is skip, dry_run rolls back, currency defaults apply, and project records the full line amount as a split in the same batch. These are semantics the schema does not convey.

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?

States a specific verb and resource ('Import balanced JSON journals'), the scope ('one company', 'atomic batch'), and explicitly contrasts itself with ledger_setup_statement_import for CSV/OFX/QFX. An agent can tell this apart from sibling import tools without inspecting the schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives explicit when-to-use and when-not-to-use routing ('For bank-statement CSV, OFX or QFX, use ledger_setup_statement_import'), plus operational guidance: use stable references for retries, use dry_run=true to validate and roll back, and the default duplicate policy is skip. This covers both tool selection and call strategy.

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