Skip to main content
Glama
ismaeldosil

FinaShopping MCP Server

by ismaeldosil

calculate-loan-payment

Calculate monthly loan payments using the French amortization system to determine payment amount, total cost, and interest for financial planning.

Instructions

Calculate monthly loan payment using the French amortization system (fixed payment). Returns payment, total amount, and interest. | Calcular la cuota mensual de un préstamo usando el sistema francés (cuota fija). Devuelve cuota, total a pagar e intereses.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
amountYesLoan amount | Monto del préstamo
rateYesAnnual interest rate (%) | Tasa de interés anual (%)
termYesTerm in months | Plazo en meses

Implementation Reference

  • Handler function that computes the monthly payment using the helper function and returns a JSON-formatted response with payment details, total amount, and interest.
    async ({ amount, rate, term }) => { const monthlyPayment = calculateFrenchPayment(amount, rate, term); const totalAmount = monthlyPayment * term; const totalInterest = totalAmount - amount; return { content: [{ type: 'text' as const, text: JSON.stringify({ principal: amount, annualRate: rate, termMonths: term, monthlyPayment: Math.round(monthlyPayment), totalAmount: Math.round(totalAmount), totalInterest: Math.round(totalInterest), currency: '$U' }, null, 2) }] }; }
  • Zod schema defining the input parameters for the tool: loan amount, annual interest rate, and term in months.
    { amount: z.number().positive().describe('Loan amount | Monto del préstamo'), rate: z.number().min(0).max(100).describe('Annual interest rate (%) | Tasa de interés anual (%)'), term: z.number().min(1).max(360).describe('Term in months | Plazo en meses') },
  • Direct registration of the 'calculate-loan-payment' tool using server.tool(), including description, input schema, and inline handler.
    server.tool( 'calculate-loan-payment', 'Calculate monthly loan payment using the French amortization system (fixed payment). Returns payment, total amount, and interest. | Calcular la cuota mensual de un préstamo usando el sistema francés (cuota fija). Devuelve cuota, total a pagar e intereses.', { amount: z.number().positive().describe('Loan amount | Monto del préstamo'), rate: z.number().min(0).max(100).describe('Annual interest rate (%) | Tasa de interés anual (%)'), term: z.number().min(1).max(360).describe('Term in months | Plazo en meses') }, async ({ amount, rate, term }) => { const monthlyPayment = calculateFrenchPayment(amount, rate, term); const totalAmount = monthlyPayment * term; const totalInterest = totalAmount - amount; return { content: [{ type: 'text' as const, text: JSON.stringify({ principal: amount, annualRate: rate, termMonths: term, monthlyPayment: Math.round(monthlyPayment), totalAmount: Math.round(totalAmount), totalInterest: Math.round(totalInterest), currency: '$U' }, null, 2) }] }; } );
  • Helper function implementing the French amortization formula to calculate the fixed monthly loan payment.
    function calculateFrenchPayment(principal: number, annualRate: number, months: number): number { const monthlyRate = annualRate / 100 / 12; if (monthlyRate === 0) return principal / months; return principal * (monthlyRate * Math.pow(1 + monthlyRate, months)) / (Math.pow(1 + monthlyRate, months) - 1); }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ismaeldosil/finashopping-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server