Skip to main content
Glama

Record document payment

record_document_payment

Record a NEW payment against ONE document, in either direction; for several bills at once use settle_bills, and to correct a payment already recorded use update_document_payment. A money-in document (invoice, recurring invoice, quote, debit note) records the payment as an income; a money-out document (bill, purchase order, GRN, credit note) is settled by recording an expense whose accountid is the document's id — the tool dispatches on the document's direction, so pass the document id and the payment details either way. Find the id yourself with list_documents (query by number or contact); never ask the user for an id. Record only what was actually paid, never an amount made up to clear a gap: if the payment is already there and only an FX or rounding gap is left ('settle it', 'it's FX'), use save_document with settled true.

Input Schema

NameRequiredDescriptionDefault
idNoDocument id to record the payment against — a money-in document (invoice / recurring invoice / quote / debit note) or a money-out document (bill / purchase order / GRN / credit note). On update, the payment id.
dateNoDate the payment was received (ISO 8601).
nameNoLabel for this payment (e.g. "Deposit", "Final payment").
notesNoFree-text notes on the payment.
amountNoPayment amount in the payment's currency.
methodNoPayment method as free text (e.g. "cash", "card", "eft") — no fixed set.
paymentNoBank/ledger account id the money moved through — received into (money-in) or paid from (money-out) (see list_accounts).
categoryNoIncome category for the payment; defaults to Sales when omitted.
currencyNoISO 4217 currency code (e.g. "ZAR", "USD"). Defaults to the business currency.
responseidNoInternal: correlation id used to return the updated entity to the frontend; omit.
exchangerateNoManual FX rate to the business base currency; omit to use the stored/auto rate.
transactionidNoBank transaction id that paid this document. When the line already carries its own unallocated income of the same amount and currency, that income is linked to the document instead of recording a second one.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / transactionid
      Added value: +{
      +  "description": "Bank transaction id that paid this document. When the line already carries its own unallocated income of the same amount and currency, that income is linked to the document instead of recording a second one.",
      +  "type": "string"
      +}
  2. First observed

TDQS

A4.5/5.0
Behavior5/5

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

Annotations only cover the safety profile (readOnly=false, destructive=false); the description goes much further by explaining that the tool internally dispatches on document direction, that money-out documents produce an expense whose accountid is the document id, and the linking behavior when a matching unallocated income exists (via transactionid). It also constrains correctness ('record only what was actually paid'), which is real behavioral guidance not present in any annotation or schema field.

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/resource, then alternatives, then the direction mechanics, then the correctness constraint. Dense but every sentence carries information; the single-block paragraph is heavier than ideal, but nothing is redundant.

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?

Handles the tricky parts of a 12-param, zero-required-parameter mutation tool: id discovery, direction dispatch, alternatives, and the FX-gap edge case. The notable gap is that it never clarifies which optional fields are effectively mandatory to actually record a payment (amount, date, payment account), leaving an agent to infer that from an all-optional schema.

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%, so the schema already documents all 12 parameters in detail. The description adds only the high-level point that the same id and payment details are passed for either direction, which is helpful but doesn't add per-parameter meaning beyond the schema. 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?

States a specific verb and resource (record a NEW payment against ONE document) plus the direction-agnostic scope, and explicitly distinguishes itself from settle_bills and update_document_payment. The money-in vs money-out dispatch rule lets an agent tell exactly what this tool covers.

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?

Names both alternatives with the selecting condition ('for several bills at once use settle_bills', 'to correct a payment already recorded use update_document_payment'), plus a further route to save_document for pure FX/rounding gaps. It also gives an explicit process rule: find the id via list_documents, never ask the user.

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