Skip to main content
Glama

Save journal entry

save_journal_entry

Create or replace a WHOLE journal entry with all its lines; to fix one line on an existing entry use update_journal_line, and to add one use add_journal_line. Pass an id to update it; omit id to create a new one. Returns the new journal entry id on create. To create/update many at once, send an items array — one all-or-nothing transaction with a single ledger recompute; each item with an id updates, each without creates.

Input Schema

NameRequiredDescriptionDefault
idNoJournal entry id. Present → update; omit → create a new one.
dateNoJournal entry date (ISO 8601).
nameNoDescription of the journal entry.
itemsNoVector of journal entry objects to create/update in one all-or-nothing batch. Preferred over repeated calls. Each item with an id updates; each without creates.
linesNoJournal lines. Each line debits or credits one account; total debits must equal total credits.
notesNoFree-text notes.
amountNoTotal amount of the journal entry.
openingNoWhether this is an opening balance entry.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • addedInput schema / properties / items / items / properties / lines / items / properties / clientid
      Added value: +{
      +  "description": "PROD-2704. Optional: the customer (clientid) or supplier (supplierid) this line books to, at most one per line. It tags the line and adds no posting; the entry then shows on that contact's statement and balance. The id must be one of this business's clients or suppliers (see list_clients, list_suppliers). Send \"$delete\" to clear it; omit it or send null to leave it alone. Naming one kind clears the other.",
      +  "type": "string"
      +}
    • addedInput schema / properties / items / items / properties / lines / items / properties / supplierid
      Added value: +{
      +  "description": "PROD-2704. Optional: the customer (clientid) or supplier (supplierid) this line books to, at most one per line. It tags the line and adds no posting; the entry then shows on that contact's statement and balance. The id must be one of this business's clients or suppliers (see list_clients, list_suppliers). Send \"$delete\" to clear it; omit it or send null to leave it alone. Naming one kind clears the other.",
      +  "type": "string"
      +}
    • addedInput schema / properties / lines / items / properties / clientid
      Added value: +{
      +  "description": "PROD-2704. Optional: the customer (clientid) or supplier (supplierid) this line books to, at most one per line. It tags the line and adds no posting; the entry then shows on that contact's statement and balance. The id must be one of this business's clients or suppliers (see list_clients, list_suppliers). Send \"$delete\" to clear it; omit it or send null to leave it alone. Naming one kind clears the other.",
      +  "type": "string"
      +}
    • addedInput schema / properties / lines / items / properties / supplierid
      Added value: +{
      +  "description": "PROD-2704. Optional: the customer (clientid) or supplier (supplierid) this line books to, at most one per line. It tags the line and adds no posting; the entry then shows on that contact's statement and balance. The id must be one of this business's clients or suppliers (see list_clients, list_suppliers). Send \"$delete\" to clear it; omit it or send null to leave it alone. Naming one kind clears the other.",
      +  "type": "string"
      +}
  2. Changed2 schema fields changed
    • addedInput schema / properties / items / items / properties / lines / items / properties / role
      Added value: +{
      +  "description": "Optional line role: what the amount is (e.g. sars-3601), set by the producer. Lowercase letters, digits and hyphens, at most 64 characters. Send \"$delete\" to clear it; omit it to leave it alone.",
      +  "type": "string"
      +}
    • addedInput schema / properties / lines / items / properties / role
      Added value: +{
      +  "description": "Optional line role: what the amount is (e.g. sars-3601), set by the producer. Lowercase letters, digits and hyphens, at most 64 characters. Send \"$delete\" to clear it; omit it to leave it alone.",
      +  "type": "string"
      +}
  3. Changed2 schema fields changed
    • changedInput schema / properties / items / items / properties / lines / items / required
      Previous value: -[
      -  "accountid",
      -  "debit",
      -  "credit"
      -]New value: +[]
    • changedInput schema / properties / lines / items / required
      Previous value: -[
      -  "accountid",
      -  "debit",
      -  "credit"
      -]New value: +[]
  4. First observed

TDQS

A4.5/5.0
Behavior4/5

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

Annotations only say readOnlyHint=false and destructiveHint=false; the description adds real context beyond that — that the whole entry and all its lines are replaced (not merged), that bulk items run as one all-or-nothing transaction with a single ledger recompute, and that a new id is returned on create. What is not disclosed is what happens to existing lines omitted from a replace, and whether anything is permanently lost, which matters given 'replace' semantics.

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 the core verb and scope, then the sibling routing, then the id rule, then the batch mode — a sensible priority order. Dense but nearly every clause carries information; the capitalized 'WHOLE' is a slightly heavy emphasis device but does signal the key distinction.

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 an 8-parameter upsert with nested line objects and no output schema, the description covers the create/update switch, the batch semantics, sibling routing, and the return value. The remaining gap is update-time behavior on an existing entry (whether omitted lines survive), which is the riskiest unknown for a 'replace' tool.

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 100%, so the baseline is 3, but the description adds meaning on top: the id-present/omit rule is framed as the create-vs-update switch and the items array is explained as a per-item create-or-update batch. It does not add anything about lines, amount, opening, or notes beyond the schema, so it sits just above baseline.

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 ('Create or replace a WHOLE journal entry with all its lines') and immediately contrasts with the two sibling tools update_journal_line and add_journal_line. An agent can distinguish whole-entry replacement from single-line editing without reading either 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 routing: use update_journal_line to fix one line, add_journal_line to add one, this tool for whole entries. It also states the id-present/omit branching and recommends the items array for bulk over repeated calls, so both the alternative-tool decision and the alternative-invocation-mode decision are covered.

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.

Resources