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

Schema Changelog

Changes observed during successful MCP inspections.

  1. 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
      +  }
      +]
  2. 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"
      +]
  3. First observed

TDQS

A4.9/5.0
Behavior5/5

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

Annotations already convey readOnlyHint and idempotentHint, and the description adds substantial behavioral context: the fully amortizing level-payment method, zero-rate interest handling, the exact formula, and that term_years and term_months are additive. No contradiction exists between the description and annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is long but every section earns its place: usage routing, computation summary, examples, input combination rules, JSON examples, output fields, formula, and REST fallback. It is front-loaded with the most critical selection guidance and structured with clear labels, making it easy to scan.

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?

Despite the presence of an output schema, the description still lists outputs and gives the formula for all edge cases (including zero annual rate). It also provides a direct REST fallback and documentation link biscuits. An agent has everything needed to invoke the tool correctly across all valid input scenarios.

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 schema covers all parameters at 100% with descriptions, so the baseline is 3. The description adds value by stating valid input combinations (term_years, term_months, or both summed) and providing two complete JSON examples, going beyond the individual parameter descriptions but not dramatically.

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 description names a specific verb ('compute the monthly payment or total interest cost') and a clear resource ('auto, personal, student or other fixed-rate installment loan'). It differentiates itself from siblings by explicitly naming mortgage-payment and debt-payoff, so an agent can select it correctly without inspecting other schemas.

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?

Explicit when-to-use ('Use this when you need...'), when-not-to-use ('Do not use this when you need property tax...'), and direct alternative routing ('use mortgage-payment', 'use debt-payoff'). This leaves no ambiguity about tool selection for amortizing fixed-rate loans.

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