Skip to main content
Glama

Link a payment

loan_link_payment
Destructive

Tie the statement row that paid the loan to it, split into principal, interest and escrow: as the lender printed it, or by the schedule when no split is given. Read loan_candidates for rows that look like the payment. When the lender's statement prints the split (principal, interest, escrow), pass it: it is the record, and it must add up to the row. With no split given, the schedule works it out from the balance and the rate, and the result says so. Anything above the scheduled payment and escrow goes to principal. Effects: payment split and recorded; the row posts once, through the loan.

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": {
      "loan_id": "<loan_id>",
      "transaction_id": "<transaction_id>",
      "reason": "<reason>"
    },
    "name": "loan_link_payment"
  }
}

Input Schema

NameRequiredDescriptionDefault
escrowNoAs the lender printed it, if it did. In cents (integer minor units) — 1250 means $12.50.
reasonYesWhy this row is this payment.
loan_idYesThe loan, e.g. LN-0001. An existing loan_loan id.
interestNoAs the lender printed it, if it did. In cents (integer minor units) — 1250 means $12.50.
principalNoAs the lender printed it, if it did. In cents (integer minor units) — 1250 means $12.50.
transaction_idYesThe statement row that paid it. An existing purch_transaction id.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=false and destructiveHint=true, and the description goes further by stating the effects explicitly: the split is recorded and the row posts once through the loan, with excess above the scheduled payment and escrow going to principal. It also discloses a hard validation rule (a supplied split must add up to the row), which the annotations do not convey. It does not say what happens if the row is already linked, which matters given destructiveHint=true and idempotentHint=false.

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?

Purpose is front-loaded in the first sentence, with derivation rules and effects following in a logical order and zero filler. The prose is slightly dense and the mid-sentence line breaks make the branch conditions a little harder to scan than they need to be.

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 destructive, non-idempotent mutation with no output schema, the description covers the essential ground: what it writes, the validation constraint on the split, the fallback derivation, and the prerequisite lookup. The remaining gap is behavioral under failure or repeat conditions — re-linking an already-linked row, or how to undo — which an agent would want before calling a destructive 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; the description adds real meaning on top by explaining that the three split fields are optional and, when supplied, are authoritative and must reconcile with the row, versus being derived from the balance and rate when omitted. The allocation rule for overpayment (above scheduled payment and escrow → principal) is information the schema does not carry.

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 opening clause gives a specific verb (tie/link), a specific resource (the statement row that paid the loan), and the payload it produces (a split into principal, interest and escrow). An agent can distinguish this from loan_unlink_payment and from the read-only loan_candidates lookup 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 Guidelines4/5

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

It gives concrete routing advice (read loan_candidates for rows that look like the payment) and states the branch condition for the optional parameters: pass the printed split when the lender prints one, otherwise let the schedule derive it. What's missing is any explicit 'when not to use' or mention of the inverse operation (loan_unlink_payment) for correcting a wrong link.

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.