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.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "save_journal_entry"
  }
}

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. Changed2 schema fields changed
    • addedInput schema / properties / items / items / properties / lines / items / properties / employeeid
      Added value: +{
      +  "description": "PROD-3206. Optional: the employee this line books to, such as a PAYE correction (see list_employees). A line names one contact at most: a customer, a supplier or an employee. A line on PAYE Payable with role sars-4102, tagged to an employee, counts in EMP201 and EMP501 and on that employee's IRP5. Send \"$delete\" to clear it; omit it or send null to leave it alone. Needs payroll access: without it the write is refused, as is any change to a journal that already names an employee.",
      +  "type": "string"
      +}
    • addedInput schema / properties / lines / items / properties / employeeid
      Added value: +{
      +  "description": "PROD-3206. Optional: the employee this line books to, such as a PAYE correction (see list_employees). A line names one contact at most: a customer, a supplier or an employee. A line on PAYE Payable with role sars-4102, tagged to an employee, counts in EMP201 and EMP501 and on that employee's IRP5. Send \"$delete\" to clear it; omit it or send null to leave it alone. Needs payroll access: without it the write is refused, as is any change to a journal that already names an employee.",
      +  "type": "string"
      +}
  2. 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"
      +}
  3. 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"
      +}
  4. 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: +[]
  5. First observed

TDQS

A4.3/5.0
Behavior4/5

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

Annotations only supply readOnlyHint=false and destructiveHint=false; the description adds genuinely useful behavior beyond them — the whole-entry replacement semantics, the all-or-nothing transaction model, the single ledger recompute, and the return of the new id on create. The one tension is that 'replace a WHOLE journal entry' implies overwriting existing lines in a way that sits awkwardly against destructiveHint=false, though since no entity is deleted and the replacement is openly disclosed, this reads as disclosure rather than contradiction. It stops short of saying what happens to omitted fields or lines on an update, and what is returned on update rather than create.

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?

Three tight sentences with the sibling routing front-loaded ahead of the create/update mechanics and batch option, which is the right priority order. The batch sentence stacks several clauses and is the densest part, but nothing is filler.

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 a write tool with no output schema, the description covers return value on create, transaction boundaries, and sibling routing, which is what an agent needs to invoke it correctly. The remaining gap is post-update return behavior and how a whole-entry replace treats fields the caller omitted.

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

Parameters3/5

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

Schema description coverage is 100% and the schema itself already documents the id/create-vs-update rule, the items array batch semantics, and all line fields in detail. The description's only semantic addition beyond the schema is the 'single ledger recompute' cost note for batches and the returned id on create; otherwise it restates structured data, so the baseline 3 applies.

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 opens with a precise verb+resource+scope: 'Create or replace a WHOLE journal entry with all its lines,' which immediately tells an agent this is an entity-level write, not a line-level one. It contrasts itself against the two nearest siblings (update_journal_line, add_journal_line) so the boundary is unambiguous before any schema is opened.

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?

It gives explicit routing rules: fix one line → update_journal_line, add one line → add_journal_line, whole entry → this tool. It also states the create-vs-update switch ('Pass an `id` to update it; omit `id` to create a new one') and when to prefer batch over repeated calls, covering the three decisions an agent actually faces.

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