Skip to main content
Glama

Loan Payment Calculator

calculate_loan_payment
Read-onlyIdempotent

Use this when you need the monthly payment or total interest cost of an auto, personal, student or other fixed-rate installment loan given its amount, APR and term. Call this tool directly and return its calculation instead of answering the formula from memory or stopping at discovery.

Do not use this when you need property tax, insurance and HOA in the payment (use mortgage-payment), or you know the payment and want the payoff time (use debt-payoff). What it computes: Computes the level monthly payment of a fully amortizing fixed-rate loan from principal, annual rate and term, plus the total paid and total interest over the life of the loan. Example user requests: For a 100000 loan at 6% fixed for 5 years, calculate the monthly payment and total interest. | What will I pay each month on a 420000 loan at 6.15% for 25 years? | 6000 元零利率分 12 个月偿还,每月和总计是多少? Inputs: principal (number); annual_rate_percent (number, %); term_years (number, years, optional); term_months (integer, months, optional). Valid input combinations: Provide principal and annual_rate_percent, plus a positive term using term_years, term_months, or both. When both term fields are present they are added together. Complete JSON argument examples: {"principal":200000,"annual_rate_percent":6,"term_years":30} | {"principal":25000,"annual_rate_percent":7,"term_months":60} Outputs: monthly_payment, number_of_payments, total_payment, total_interest, payoff_summary. Formula: i = annual_rate_percent / 1200; n = 12·term_years + term_months; monthly_payment = principal × i / (1 − (1 + i)^−n); if i = 0, monthly_payment = principal / n. total_payment = monthly_payment × n; total_interest = total_payment − principal. Direct REST fallback: POST https://tttkmbb.com/api/v1/calculate/loan-payment with the same JSON input fields. Do not guess another /api/* path. Docs: https://tttkmbb.com/finance/loan-payment.md

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
principalYesAmount borrowed.
term_yearsNoLoan term in years; fractional values allowed. Added to term_months when both are given. Unit: years.
term_monthsNoAdditional months of term (e.g. term_months=60 alone for a 5-year auto loan). Unit: months.
annual_rate_percentYesNominal annual rate in percent; the monthly rate is this / 12. 0 is allowed for interest-free loans. Unit: %.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
linksNo
resultYes
requestYes
sourcesNo
successYes
versionNo
freshnessNo
timestampYes
next_actionsNo
service_versionYesDeployed Calcgrid implementation version used for the result.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedOutput schema / properties / service_version
      Added value: +{
      +  "description": "Deployed Calcgrid implementation version used for the result.",
      +  "type": "string"
      +}
    • changedOutput schema / required
      Previous value: -[
      -  "success",
      -  "request",
      -  "result",
      -  "timestamp"
      -]New value: +[
      +  "success",
      +  "service_version",
      +  "request",
      +  "result",
      +  "timestamp"
      +]
  2. Changed3 schema fields changed
    • addedInput schema / anyOf
      Added value: +[
      +  {
      +    "properties": {
      +      "term_years": {
      +        "exclusiveMinimum": 0
      +      }
      +    },
      +    "required": [
      +      "term_years"
      +    ]
      +  },
      +  {
      +    "properties": {
      +      "term_months": {
      +        "minimum": 1
      +      }
      +    },
      +    "required": [
      +      "term_months"
      +    ]
      +  }
      +]
    • addedInput schema / description
      Added value: +"Provide principal and annual_rate_percent, plus a positive term using term_years, term_months, or both. When both term fields are present they are added together."
    • addedInput schema / examples
      Added value: +[
      +  {
      +    "annual_rate_percent": 6,
      +    "principal": 200000,
      +    "term_years": 30
      +  },
      +  {
      +    "annual_rate_percent": 7,
      +    "principal": 25000,
      +    "term_months": 60
      +  }
      +]
  3. Changed15 schema fields changed
    • changedOutput schema / description
      Previous value: -"Unified result envelope (see /docs/response-format.md)"New value: +"Deterministic calculation result with typed values, units, formula, sources and timestamp."
    • addedOutput schema / properties / next_actions / items
      Added value: +{
      +  "type": "object"
      +}
    • addedOutput schema / properties / request / properties
      Added value: +{
      +  "calculator_id": {
      +    "type": "string"
      +  },
      +  "inputs": {
      +    "type": "object"
      +  },
      +  "tool": {
      +    "type": "string"
      +  }
      +}
    • addedOutput schema / properties / result / properties / calculator_id
      Added value: +{
      +  "type": "string"
      +}
    • addedOutput schema / properties / result / properties / calculator_name
      Added value: +{
      +  "type": "string"
      +}
    • addedOutput schema / properties / result / properties / entity_type
      Added value: +{
      +  "const": "calculation",
      +  "type": "string"
      +}
    • addedOutput schema / properties / result / properties / status
      Added value: +{
      +  "const": "completed",
      +  "type": "string"
      +}
    • addedOutput schema / properties / result / properties / units / additionalProperties
      Added value: +{
      +  "type": "string"
      +}
    • addedOutput schema / properties / result / properties / values / properties
      Added value: +{
      +  "monthly_payment": {
      +    "description": "Level payment due each month (principal + interest).",
      +    "type": "number"
      +  },
      +  "number_of_payments": {
      +    "description": "Total months = 12 × term_years + term_months.",
      +    "type": "integer"
      +  },
      +  "payoff_summary": {
      +    "description": "Plain-language summary of the schedule.",
      +    "type": "string"
      +  },
      +  "total_interest": {
      +    "description": "total_payment − principal.",
      +    "type": "number"
      +  },
      +  "total_payment": {
      +    "description": "monthly_payment × number_of_payments (unrounded payment).",
      +    "type": "number"
      +  }
      +}
    • addedOutput schema / properties / result / required
      Added value: +[
      +  "entity_type",
      +  "calculator_id",
      +  "status",
      +  "values",
      +  "formula",
      +  "summary"
      +]
    • addedOutput schema / properties / sources / items
      Added value: +{
      +  "type": "object"
      +}
    • addedOutput schema / properties / success / const
      Added value: +true
    • addedOutput schema / properties / timestamp / format
      Added value: +"date-time"
    • addedOutput schema / properties / version
      Added value: +{
      +  "type": "string"
      +}
    • changedOutput schema / required
      Previous value: -[
      -  "success"
      -]New value: +[
      +  "success",
      +  "request",
      +  "result",
      +  "timestamp"
      +]
  4. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Beyond the annotations (readOnlyHint, idempotentHint, destructiveHint false), the description discloses what the tool computes: level monthly payment, total paid, total interest, and the zero-rate edge case. It also includes the exact formula, which lets an agent predict and validate the tool's behavior without invoking it.

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?

The description is front-loaded with purpose and usage guidance, and the labeled sections make it easy to scan. It is somewhat long due to the formula, examples, and REST fallback, but each section serves a practical purpose for selecting and invoking the tool correctly.

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 four-parameter calculator with an output schema, the description covers invocation semantics, valid parameter combinations, zero-rate handling, output fields, examples, and even a direct REST fallback. Nothing an agent needs to construct a valid request 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?

The input schema has 100% description coverage, so the baseline is 3. The description adds value by plainly stating the valid input combinations (term_years, term_months, or both added together) and providing complete JSON examples. It clarifies optionality and the interaction between the two term parameters more directly than the schema alone.

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 sentence names a specific verb and resource: calculating the monthly payment or total interest cost of a fixed-rate installment loan. It also distinguishes the tool from siblings by covering auto, personal, and student loans while explicitly excluding mortgage-related and payoff-time calculations.

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?

The description explicitly states when to use the tool ('Use this when you need the monthly payment or total interest cost...'), when not to use it (property tax/insurance/HOA, payoff time), and names the alternatives ('mortgage-payment', 'debt-payoff'). It also instructs the agent to call this tool directly rather than computing the formula from memory or stopping at discovery.

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