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);
    }
Behavior3/5

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

With no annotations, the description carries full burden. It discloses the calculation method (French amortization) and output structure, but lacks details on error handling, precision, or limitations (e.g., rate/term bounds). It doesn't contradict annotations (none provided).

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 front-loaded with key information in a single bilingual sentence, with no redundant or verbose elements. Every part (calculation method, output) earns its place efficiently.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a calculation tool with no annotations and no output schema, the description adequately covers purpose and method. However, it lacks details on output format, error cases, or example usage, which would enhance completeness given the tool's functional complexity.

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?

Schema description coverage is 100%, providing clear parameter details. The description adds context by specifying the amortization system and output values, but doesn't elaborate on parameter interactions or calculation nuances beyond what the schema implies.

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 clearly states the specific action ('calculate monthly loan payment'), the method ('French amortization system'), and the output ('returns payment, total amount, and interest'). It distinguishes from siblings like 'compare-loans' or 'search-loans' by focusing on calculation rather than comparison or search.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for loan payment calculation with fixed amortization, but provides no explicit guidance on when to use this tool versus alternatives like 'compare-loans' or 'get-loan-requirements'. It lacks context on prerequisites or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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