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
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. 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
      +  }
      +]
  3. Added

TDQS

A4.7/5.0
Behavior5/5

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

Annotations declare readOnlyHint, idempotentHint, and non-destructive behavior, so the description carries less safety burden. It adds meaningful behavioral context: the fixed-rate, fully amortizing assumption, blind spots like ignoring time value of money, the formula used, and the 'not financial advice' disclaimer. 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.

Conciseness5/5

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

The description is long but every section earns its place: usage, exclusions, computation summary, example requests, inputs, outputs, formula, REST fallback, and docs. It is front-loaded with the invocation criterion and structured so an agent can quickly decide, call, and verify results.

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 seven-parameter calculator, the description is exceptionally complete. It includes exact input and output names, complete JSON examples, the formula, a direct REST fallback, documentation link, and limitation notes; an output schema also exists, so return-value details do not need to be repeated.

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 repeats parameter names, types, and optionality and clarifies the formula that consumes them, but it adds little meaning beyond what the schema already provides with examples, units, defaults, and descriptions.

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 states a specific verb and resource: it compares two fixed-rate, fully amortizing loan offers for the same amount and reports payments, fees, total interest, and total cost side by side. It also differentiates itself from siblings by naming refinance-break-even and loan-payment as the tools for adjacent but different scenarios.

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?

It opens with an explicit 'Use this when...' condition and then gives explicit 'Do not use this when...' exclusions, naming alternative tools and the early-payoff caveat. The instruction to call the tool directly rather than computing from memory further clarifies the intended invocation behavior.

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