Skip to main content
Glama

Record Invoice Payment

record_invoice_payment

Record a payment received outside Spark (cash, check, bank transfer, card taken elsewhere) on an issued invoice — the invoice list's Mark as paid. Nothing is charged: this never runs a card or bank payment. The amount defaults to what is still owed; a smaller amount records a partial payment, and more than is owed is refused. The invoice is marked paid once its payments cover it, and the payment posts to connected accounting applied to the invoice. The method defaults to the invoice's payment method. Two-step: preview=true, then commit with the previewReceipt.

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": {
      "invoiceId": "<invoiceId>"
    },
    "name": "record_invoice_payment"
  }
}

Input Schema

NameRequiredDescriptionDefault
amountNoAmount received. Defaults to what is still owed on the invoice.
methodNoHow it was paid: cash, check, bank_transfer, credit_card (taken elsewhere), cash_on_delivery, advance_payment or other. Defaults to the invoice's payment method.
previewNoStep 1 of the required two-step write: set true to validate and receive a structured preview plus a single-use previewReceipt. Nothing is written until the commit call.
clientIdNoOptional client id (GUID) for operator (unpinned) credentials on 3PL tenants.
invoiceIdYesInvoice id (GUID) or number from list_invoices.
idempotencyKeyNoCaller-generated idempotency key; required with previewReceipt to commit.
previewReceiptNoStep 2: the receipt returned by the preview call. Supply with a fresh idempotencyKey to commit.

Output Schema

NameRequiredDescriptionDefault
okNo
numberNo
paidAtNo
statusNo
previewNo
warningsNo
expiresAtNo
invoiceIdNo
paymentIdNo
totalAmountNo
actionItemIdNo
confirmationNo
documentKindNo
correlationIdNo
approvalResultNo
idempotencyKeyNo
previewReceiptNo
approvalRequiredNo
approvalRuleNameNo
idempotentReplayNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Annotations declare this is a non-read-only, non-destructive, non-idempotent write, and the description adds substantial behavior beyond that: partial payments are allowed, overpayment is refused, the invoice flips to paid only once covered, the payment posts to connected accounting, and defaults are applied for amount and method. It also discloses the required two-step preview-then-commit flow with a single-use previewReceipt, which is exactly the kind of process detail annotations cannot express.

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 action and immediately followed by the most important disambiguation ('Nothing is charged'), then the amount rules, then the two-step protocol. Nearly every clause carries operational meaning, though the payment-method list and the method-default sentence could be trimmed since the schema already enumerates the same values.

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 7-parameter mutation with a preview/commit protocol, the description covers the write semantics, arithmetic guardrails, downstream accounting side effect, and the two-step commit requirement. An output schema exists, so it is reasonable that return values are not restated here.

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 would be 3, but the description adds genuine meaning for the two business-critical parameters: amount defaults to the outstanding balance and may be partial but never exceed it, and method defaults to the invoice's stored payment method. The preview/previewReceipt two-step semantics are restated usefully but largely duplicate the schema text.

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 payment ... on an issued invoice') and maps it to a known UI action ('the invoice list's Mark as paid'). It also explicitly excludes the adjacent capability by saying 'Nothing is charged: this never runs a card or bank payment', so an agent can tell it apart from a charge/payment-processing tool without opening 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 Guidelines4/5

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

Gives clear context for when this applies: payments received outside the system (cash, check, bank transfer, card taken elsewhere). It also documents the guardrail that amounts above what is owed are refused and that a smaller amount becomes a partial payment. It stops short of naming a specific sibling for the in-system card-charge case, so it gets a 4 rather than a 5.

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