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. Changed4 schema fields changed
    • changedInput schema / properties / items / items / properties / lines / items / properties / exchangerate / description
      Previous value: -"Optional. Base currency per ONE unit of that currency, as booked (19.1938 rand per euro). Omitted, it is the line's rand amount over its foreign amount."New value: +"Optional. Base currency per ONE unit of that currency, as booked (20.0480 rand per euro). Omitted, it is the line's rand amount over its foreign amount."
    • changedInput schema / properties / items / items / properties / lines / items / properties / foreignamount / description
      Previous value: -"Optional. The line's amount in that currency, positive, as booked: €881.17 of a R16,912.33 line. Kept as written and never converted again. Omitted on a foreign-currency account, stub works it out at the business's closing rate for the day, else its daily rate."New value: +"Optional. The line's amount in that currency, positive, as booked: €1,250.00 of a R25,060.00 line. Kept as written and never converted again. Omitted on a foreign-currency account, stub works it out at the business's closing rate for the day, else its daily rate."
    • changedInput schema / properties / lines / items / properties / exchangerate / description
      Previous value: -"Optional. Base currency per ONE unit of that currency, as booked (19.1938 rand per euro). Omitted, it is the line's rand amount over its foreign amount."New value: +"Optional. Base currency per ONE unit of that currency, as booked (20.0480 rand per euro). Omitted, it is the line's rand amount over its foreign amount."
    • changedInput schema / properties / lines / items / properties / foreignamount / description
      Previous value: -"Optional. The line's amount in that currency, positive, as booked: €881.17 of a R16,912.33 line. Kept as written and never converted again. Omitted on a foreign-currency account, stub works it out at the business's closing rate for the day, else its daily rate."New value: +"Optional. The line's amount in that currency, positive, as booked: €1,250.00 of a R25,060.00 line. Kept as written and never converted again. Omitted on a foreign-currency account, stub works it out at the business's closing rate for the day, else its daily rate."
  2. Changed6 schema fields changed
    • addedInput schema / properties / items / items / properties / lines / items / properties / currency
      Added value: +{
      +  "description": "Optional. The currency this line's foreign amount is in. A line on a foreign-currency account takes the account's own; name one on a rand account only for an amount owed in another currency, such as a euro receivable.",
      +  "type": "string"
      +}
    • addedInput schema / properties / items / items / properties / lines / items / properties / exchangerate
      Added value: +{
      +  "description": "Optional. Base currency per ONE unit of that currency, as booked (19.1938 rand per euro). Omitted, it is the line's rand amount over its foreign amount.",
      +  "type": "number"
      +}
    • addedInput schema / properties / items / items / properties / lines / items / properties / foreignamount
      Added value: +{
      +  "description": "Optional. The line's amount in that currency, positive, as booked: €881.17 of a R16,912.33 line. Kept as written and never converted again. Omitted on a foreign-currency account, stub works it out at the business's closing rate for the day, else its daily rate.",
      +  "type": "number"
      +}
    • addedInput schema / properties / lines / items / properties / currency
      Added value: +{
      +  "description": "Optional. The currency this line's foreign amount is in. A line on a foreign-currency account takes the account's own; name one on a rand account only for an amount owed in another currency, such as a euro receivable.",
      +  "type": "string"
      +}
    • addedInput schema / properties / lines / items / properties / exchangerate
      Added value: +{
      +  "description": "Optional. Base currency per ONE unit of that currency, as booked (19.1938 rand per euro). Omitted, it is the line's rand amount over its foreign amount.",
      +  "type": "number"
      +}
    • addedInput schema / properties / lines / items / properties / foreignamount
      Added value: +{
      +  "description": "Optional. The line's amount in that currency, positive, as booked: €881.17 of a R16,912.33 line. Kept as written and never converted again. Omitted on a foreign-currency account, stub works it out at the business's closing rate for the day, else its daily rate.",
      +  "type": "number"
      +}
  3. 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"
      +}
  4. 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"
      +}
  5. 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"
      +}
  6. 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: +[]
  7. First observed

TDQS

A4.6/5.0
Behavior4/5

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

Annotations only declare readOnlyHint=false and destructiveHint=false, so the description carries the real behavioral load, and it does: whole-entry replacement semantics, all-or-nothing batching, a single ledger recompute, and that the new journal entry id is returned on create. It does not mention permission requirements (e.g. payroll access gating employee-tagged entries), which the schema supplies but the description could have surfaced. The 'replace a WHOLE entry' wording sits in mild tension with destructiveHint=false but does not outright contradict it, since the entry id survives.

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 batching. Every sentence carries information; the trailing items-array sentence is dense but justified by the batch semantics it discloses. Slightly long, but no wasted clauses.

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?

For a mutation tool with no output schema, the description covers the essentials an agent needs: create-vs-update via id, whole-entry replacement scope, batch atomicity, and the create return value. Nothing critical to correct invocation is missing.

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, and the description adds genuine meaning on top: the id present/omit rule for update vs create, and the items array's per-item id semantics plus its all-or-nothing, single-recompute character and preference over repeated calls. It does not reinterpret other fields like opening or lines balancing, which stay with the schema.

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 with explicit scope: 'Create or replace a WHOLE journal entry with all its lines.' It immediately names the two sibling tools it is not (update_journal_line for one line, add_journal_line for adding), so the agent can discriminate without opening any 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 rules: use update_journal_line to fix one line, add_journal_line to add one; pass id to update, omit id to create; prefer the items array over repeated calls for bulk work. Both when-to-use and when-not-to-use 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