Skip to main content
Glama

Loan Comparison Calculator

compare_loans
Read-onlyIdempotent

Use this when you have two loan or mortgage quotes with different rates, terms or fees for the same amount and want the payments and lifetime costs side by side. 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 are replacing an existing loan (use refinance-break-even), only need one loan's payment (use loan-payment), or will sell or repay early (this compares full-term costs and ignores the time value of money). Informational; not financial advice. What it computes: Compares two fixed-rate, fully amortizing loan offers for the same amount: the level monthly payment, total interest, up-front fees and total cost (interest + fees) of each, and which offer costs less over its full term. Example user requests: Compare a 300000 loan at 6% for 30 years with 3000 in fees against 5.5% for 15 years with 5000 in fees. | Which of these two fixed-rate offers has the lower lifetime interest and fees? | 同样贷款30万元,方案A年利率6%期限30年,方案B年利率5.5%期限15年,比较月供和总成本。 Inputs: loan_amount (number); rate_a_percent (number, %); term_a_years (number, years); fees_a (number, optional); rate_b_percent (number, %); term_b_years (number, years); fees_b (number, optional). Complete JSON argument examples: {"loan_amount":300000,"rate_a_percent":6,"term_a_years":30,"fees_a":3000,"rate_b_percent":5.5,"term_b_years":15,"fees_b":5000} | {"loan_amount":25000,"rate_a_percent":7,"term_a_years":5,"rate_b_percent":6,"term_b_years":6,"fees_b":500} Outputs: payment_a, payment_b, total_interest_a, total_interest_b, total_cost_a, total_cost_b, cheaper_loan, monthly_payment_difference, total_cost_difference, comparison, summary. Formula: For each loan: i = rate/1200, n = 12 × term_years, payment = loan_amount × i / (1 − (1 + i)^−n) (loan_amount / n if i = 0); total_interest = payment × n − loan_amount; total_cost = total_interest + fees. cheaper_loan = the loan with the lower total_cost; monthly_payment_difference = payment_a − payment_b; total_cost_difference = total_cost_a − total_cost_b Direct REST fallback: POST https://tttkmbb.com/api/v1/calculate/loan-comparison with the same JSON input fields. Do not guess another /api/* path. Docs: https://tttkmbb.com/finance/loan-comparison.md

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fees_aNoUp-front fees of loan A (origination, points, closing costs), paid separately rather than financed.
fees_bNoUp-front fees of loan B.
loan_amountYesAmount borrowed under both offers.
term_a_yearsYesTerm of loan A in years (fractions allowed; rounded to whole months). Unit: years.
term_b_yearsYesTerm of loan B in years. Unit: years.
rate_a_percentYesAnnual nominal rate of loan A in percent; the monthly rate is this / 12. Unit: %.
rate_b_percentYesAnnual nominal rate of loan B in percent. 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. Changed1 schema field changed
    • addedInput schema / examples
      Added value: +[
      +  {
      +    "fees_a": 3000,
      +    "fees_b": 5000,
      +    "loan_amount": 300000,
      +    "rate_a_percent": 6,
      +    "rate_b_percent": 5.5,
      +    "term_a_years": 30,
      +    "term_b_years": 15
      +  },
      +  {
      +    "fees_b": 500,
      +    "loan_amount": 25000,
      +    "rate_a_percent": 7,
      +    "rate_b_percent": 6,
      +    "term_a_years": 5,
      +    "term_b_years": 6
      +  }
      +]
  2. Added

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already declare readOnlyHint, idempotentHint, and destructiveHint, but the description adds meaningful behavioral context: it computes full-term costs only, ignores the time value of money, assumes fixed-rate fully amortizing loans, and is informational rather than financial advice. No contradiction with annotations exists.

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 long, but well-structured and front-loaded with the core use case and exclusions. Every major section (what it computes, examples, inputs, outputs, formula, REST fallback) earns its place for a complex calculator. Minor redundancy exists with the schema examples and output list, so it is not perfectly concise.

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 calculator with an output schema and full schema documentation, the description is exceptionally complete: it includes use cases, exclusions, formulas, output names, example JSON, a REST fallback, and docs URL. An agent has everything needed to select and invoke the tool correctly.

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 baseline is 3. The description's 'Inputs' section restates parameter names and adds example JSON, but it does not add semantic detail beyond what the schema already provides for each parameter. This is adequate but not an extra source of parameter meaning.

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 and resource ('compares two fixed-rate, fully amortizing loan offers') and clearly defines the scope: two loan quotes for the same amount with different rates, terms, or fees. It also distinguishes itself from nearby siblings by stating it covers payments, interest, fees, and total cost side by side.

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 says when to use the tool ('when you have two loan or mortgage quotes...') and gives explicit when-not-to-use conditions with named alternatives (refinance-break-even, loan-payment) and a behavioral caveat (early sale/repayment). This leaves no ambiguity about routing.

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