# Financial Loan Amortization Calculator

## Links

- Product page URL: https://www.agentpmt.com/marketplace/financial-loan-calculator
- Product markdown URL: https://www.agentpmt.com/marketplace/financial-loan-calculator?format=agent-md
- Product JSON URL: https://www.agentpmt.com/marketplace/financial-loan-calculator?format=agent-json

## Overview

- Product ID: 69858a60269243768b447d61
- Vendor: Apoth3osis
- Type: function
- Unit type: request
- Price: 500 credits
- Categories: Scientific Computing, Financial Modeling, Financial Data, Percentage & Ratio Calculators, Finance & Accounting, Risk Management & Analytics
- Generated at: 2026-05-21T08:23:38.303Z

### Page Description

Full-featured financial loan calculator supporting 11 operations: payment calculation, principal estimation, term calculation, simple and compound interest, amortization schedules with CSV export, side-by-side loan comparison, DTI-based affordability analysis, refinance break-even evaluation, payoff acceleration modeling with extra and lump-sum payments, and APR-to-effective-rate conversion. Handles mortgages, auto loans, personal loans, and investment growth scenarios with configurable compounding, payment frequencies, interest-only periods, and balloon terms.

### Agent Description

Use this tool for any loan math or mortgage calculation. Supports: calculate_payment (periodic payment amount), calculate_loan_principal (max borrowing from a target payment), calculate_term (payoff timeline), simple_interest, compound_interest (with optional recurring contributions), amortization_schedule (full table with downloadable CSV), compare_loans (rank scenarios by total cost, payment, or interest), affordability_analysis (max loan and home price from income and debts), refinance_break_even (savings, break-even months, net benefit), payoff_acceleration (interest and term savings from extra payments), and rate_conversion (nominal APR to effective annual and per-period rates). All actions accept standard loan parameters: principal, annual_rate, years. Send {"action": "get_instructions"} for full parameter documentation and examples.

## Details

### Details

Full-featured financial loan calculator supporting 11 operations: payment calculation, principal estimation, term calculation, simple and compound interest, amortization schedules with CSV export, side-by-side loan comparison, DTI-based affordability analysis, refinance break-even evaluation, payoff acceleration modeling with extra and lump-sum payments, and APR-to-effective-rate conversion. Handles mortgages, auto loans, personal loans, and investment growth scenarios with configurable compounding, payment frequencies, interest-only periods, and balloon terms.

### Actions

- `calculate_payment` (5 credits): Compute the periodic payment for an amortizing loan. Supports interest-only periods, balloon payments, and configurable payment/compounding frequencies.
- `calculate_loan_principal` (5 credits): Calculate the maximum loan principal supported by a given periodic payment amount.
- `calculate_term` (5 credits): Calculate the number of periods and years required to pay off a loan given principal, rate, and payment amount.
- `simple_interest` (5 credits): Calculate simple (non-compounded) interest totals for a given principal, rate, and duration.
- `compound_interest` (5 credits): Calculate compound interest growth over time, optionally with periodic contributions. Supports configurable compounding frequency and contribution timing.
- `amortization_schedule` (5 credits): Build a full amortization table with support for extra payments, one-time lump sums, interest-only periods, balloon payments, and optional CSV file export to cloud storage.
- `compare_loans` (5 credits): Compare multiple loan scenarios side-by-side and rank by selected metric (lowest payment, lowest interest, or lowest total cost).
- `affordability_analysis` (5 credits): Estimate affordable monthly payment, maximum loan principal, and maximum home price based on income, debts, and DTI ratios.
- `refinance_break_even` (5 credits): Estimate payment savings, break-even period, and net lifetime benefit of refinancing a loan.
- `payoff_acceleration` (5 credits): Model interest and term savings from recurring and one-time extra payments by comparing baseline vs accelerated payoff scenarios.
- `rate_conversion` (5 credits): Convert a nominal annual percentage rate (APR) into effective annual, payment-period, and daily effective rates.

### Use Cases

Mortgage payment planning,Auto loan payment estimation,Amortization schedule download,Debt payoff acceleration analysis,Refinance break-even evaluation,Simple and compound interest projection,Debt-to-income affordability checks,Balloon payment scenario modeling,Interest-only period planning,Loan comparison analysis

### Workflows Using This Tool

#### Rental Property Cash Flow Analyzer

Analyzes rental property investment viability by calculating mortgage payments, computing net operating income and cash-on-cash returns, projecting cash flows, generating return visualizations, creating a comprehensive investment analysis report, and delivering it to the investor. Essential for real estate investors evaluating rental property acquisitions.

- Page URL: https://www.agentpmt.com/agent-workflow-skills/rental-property-cash-flow-analyzer
- Markdown URL: https://www.agentpmt.com/agent-workflow-skills/rental-property-cash-flow-analyzer?format=agent-md
- Published: 2026-02-18T16:43:43.406Z

### Related Content

No related content is currently linked to this product.

## Integration Details

### DynamicMCP

- Setup page URL: https://www.agentpmt.com/dynamic-mcp
- Claude setup guide: https://www.agentpmt.com/dynamic-mcp?platform=claude#videos
- ChatGPT setup guide: https://www.agentpmt.com/dynamic-mcp?platform=chatgpt#videos
- Cursor setup guide: https://www.agentpmt.com/dynamic-mcp?platform=cursor#videos
- Windsurf setup guide: https://www.agentpmt.com/dynamic-mcp?platform=windsurf#videos

STDIO connector for Claude Code, Codex, Cursor, Zed, and other LLMs that require STDIO or custom connections. This lightweight connector routes requests to `https://api.agentpmt.com/mcp`. All tool execution happens in the cloud and the server cannot edit any files on your computer.

```bash
npm install -g @agentpmt/mcp-router
agentpmt-setup
```

### REST API

The live page renders cURL, Python, JavaScript, and Node.js examples. Logged-in users see those examples prefilled with their own API and budget credentials.

- Purchase endpoint: https://api.agentpmt.com/products/purchase
- Authorization format: `Bearer <base64(apiKey:budgetKey)>`

```bash
curl -X POST "https://api.agentpmt.com/products/purchase" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer eW91ci1hcGkta2V5LWhlcmU6eW91ci1idWRnZXQta2V5LWhlcmU=" \
  -d '{
    "product_id": "69858a60269243768b447d61",
    "parameters": {
      "action": "calculate_payment",
      "principal": 0,
      "annual_rate": 0,
      "years": 0,
      "payments_per_year": 12,
      "compounding_per_year": 12,
      "future_value": 0,
      "balloon_payment": 0,
      "interest_only_periods": 0
    }
  }'
```

### Autonomous Agents

Do not use the abbreviated instructions in this product markdown for wallet-based invocation. Retrieve the full External Agent API markdown document instead.

- External Agent API page URL: https://www.agentpmt.com/external-agent-api
- External Agent API markdown URL: https://www.agentpmt.com/external-agent-api?format=agent-md

### Schema

#### Parameters

- Schema type: actions

```json
{
  "actions": {
    "calculate_payment": {
      "description": "Compute the periodic payment for an amortizing loan. Supports interest-only periods, balloon payments, and configurable payment/compounding frequencies.",
      "properties": {
        "principal": {
          "type": "number",
          "description": "Loan principal amount",
          "required": true,
          "minimum": 0
        },
        "annual_rate": {
          "type": "number",
          "description": "Nominal annual interest rate in percent",
          "required": true,
          "minimum": 0,
          "maximum": 100
        },
        "years": {
          "type": "number",
          "description": "Loan term in years",
          "required": true,
          "minimum": 0,
          "maximum": 100
        },
        "payments_per_year": {
          "type": "integer",
          "description": "Payment frequency per year",
          "required": false,
          "default": 12,
          "minimum": 1,
          "maximum": 365
        },
        "compounding_per_year": {
          "type": "integer",
          "description": "Compounding frequency per year",
          "required": false,
          "default": 12,
          "minimum": 1,
          "maximum": 365
        },
        "future_value": {
          "type": "number",
          "description": "Target future value after final payment",
          "required": false,
          "default": 0,
          "minimum": 0
        },
        "balloon_payment": {
          "type": "number",
          "description": "Balloon amount due at maturity",
          "required": false,
          "default": 0,
          "minimum": 0
        },
        "interest_only_periods": {
          "type": "integer",
          "description": "Number of interest-only payment periods at the start",
          "required": false,
          "default": 0,
          "minimum": 0
        }
      }
    },
    "calculate_loan_principal": {
      "description": "Calculate the maximum loan principal supported by a given periodic payment amount.",
      "properties": {
        "payment_amount": {
          "type": "number",
          "description": "Periodic payment amount",
          "required": true,
          "minimum": 0
        },
        "annual_rate": {
          "type": "number",
          "description": "Nominal annual interest rate in percent",
          "required": true,
          "minimum": 0,
          "maximum": 100
        },
        "years": {
          "type": "number",
          "description": "Loan term in years (provide years or target_periods or both)",
          "required": false,
          "minimum": 0,
          "maximum": 100
        },
        "target_periods": {
          "type": "integer",
          "description": "Target number of payment periods (alternative to years)",
          "required": false,
          "minimum": 1,
          "maximum": 12000
        },
        "payments_per_year": {
          "type": "integer",
          "description": "Payment frequency per year",
          "required": false,
          "default": 12,
          "minimum": 1,
          "maximum": 365
        },
        "compounding_per_year": {
          "type": "integer",
          "description": "Compounding frequency per year",
          "required": false,
          "default": 12,
          "minimum": 1,
          "maximum": 365
        },
        "future_value": {
          "type": "number",
          "description": "Target future value",
          "required": false,
          "default": 0,
          "minimum": 0
        },
        "balloon_payment": {
          "type": "number",
          "description": "Balloon due at maturity",
          "required": false,
          "default": 0,
          "minimum": 0
        }
      }
    },
    "calculate_term": {
      "description": "Calculate the number of periods and years required to pay off a loan given principal, rate, and payment amount.",
      "properties": {
        "principal": {
          "type": "number",
          "description": "Loan principal",
          "required": true,
          "minimum": 0
        },
        "annual_rate": {
          "type": "number",
          "description": "Nominal annual interest rate in percent",
          "required": true,
          "minimum": 0,
          "maximum": 100
        },
        "payment_amount": {
          "type": "number",
          "description": "Periodic payment amount",
          "required": true,
          "minimum": 0
        },
        "payments_per_year": {
          "type": "integer",
          "description": "Payment frequency per year",
          "required": false,
          "default": 12,
          "minimum": 1,
          "maximum": 365
        },
        "compounding_per_year": {
          "type": "integer",
          "description": "Compounding frequency per year",
          "required": false,
          "default": 12,
          "minimum": 1,
          "maximum": 365
        }
      }
    },
    "simple_interest": {
      "description": "Calculate simple (non-compounded) interest totals for a given principal, rate, and duration.",
      "properties": {
        "principal": {
          "type": "number",
          "description": "Principal amount",
          "required": true,
          "minimum": 0
        },
        "annual_rate": {
          "type": "number",
          "description": "Annual interest rate in percent",
          "required": true,
          "minimum": 0,
          "maximum": 100
        },
        "years": {
          "type": "number",
          "description": "Duration in years",
          "required": true,
          "minimum": 0,
          "maximum": 100
        }
      }
    },
    "compound_interest": {
      "description": "Calculate compound interest growth over time, optionally with periodic contributions. Supports configurable compounding frequency and contribution timing.",
      "properties": {
        "principal": {
          "type": "number",
          "description": "Initial principal amount",
          "required": true,
          "minimum": 0
        },
        "annual_rate": {
          "type": "number",
          "description": "Annual interest rate in percent",
          "required": true,
          "minimum": 0,
          "maximum": 100
        },
        "years": {
          "type": "number",
          "description": "Investment duration in years",
          "required": true,
          "minimum": 0,
          "maximum": 100
        },
        "compounding_per_year": {
          "type": "integer",
          "description": "Compounding frequency per year",
          "required": false,
          "default": 12,
          "minimum": 1,
          "maximum": 365
        },
        "periodic_contribution": {
          "type": "number",
          "description": "Amount added each contribution period",
          "required": false,
          "default": 0,
          "minimum": 0
        },
        "contribution_frequency_per_year": {
          "type": "integer",
          "description": "How often contributions are made per year",
          "required": false,
          "default": 12,
          "minimum": 1,
          "maximum": 365
        },
        "contribution_timing": {
          "type": "string",
          "description": "Whether contribution is made at period end or beginning",
          "required": false,
          "default": "end",
          "enum": [
            "end",
            "beginning"
          ]
        }
      }
    },
    "amortization_schedule": {
      "description": "Build a full amortization table with support for extra payments, one-time lump sums, interest-only periods, balloon payments, and optional CSV file export to cloud storage.",
      "properties": {
        "principal": {
          "type": "number",
          "description": "Loan principal",
          "required": true,
          "minimum": 0
        },
        "annual_rate": {
          "type": "number",
          "description": "Nominal annual interest rate in percent",
          "required": true,
          "minimum": 0,
          "maximum": 100
        },
        "years": {
          "type": "number",
          "description": "Loan term in years",
          "required": true,
          "minimum": 0,
          "maximum": 100
        },
        "payments_per_year": {
          "type": "integer",
          "description": "Payment frequency per year",
          "required": false,
          "default": 12,
          "minimum": 1,
          "maximum": 365
        },
        "compounding_per_year": {
          "type": "integer",
          "description": "Compounding frequency per year",
          "required": false,
          "default": 12,
          "minimum": 1,
          "maximum": 365
        },
        "future_value": {
          "type": "number",
          "description": "Target future value",
          "required": false,
          "default": 0,
          "minimum": 0
        },
        "balloon_payment": {
          "type": "number",
          "description": "Balloon due at maturity",
          "required": false,
          "default": 0,
          "minimum": 0
        },
        "interest_only_periods": {
          "type": "integer",
          "description": "Interest-only period count",
          "required": false,
          "default": 0,
          "minimum": 0
        },
        "extra_payment": {
          "type": "number",
          "description": "Recurring extra principal each period",
          "required": false,
          "default": 0,
          "minimum": 0
        },
        "extra_payment_start_period": {
          "type": "integer",
          "description": "Period to begin recurring extra payments",
          "required": false,
          "default": 1,
          "minimum": 1
        },
        "one_time_extra_payments": {
          "type": "array",
          "description": "List of one-time extra principal payments",
          "required": false,
          "items": {
            "type": "object",
            "properties": {
              "period": {
                "type": "integer",
                "description": "Payment period index (1-based)",
                "required": true,
                "minimum": 1
              },
              "amount": {
                "type": "number",
                "description": "Extra principal payment amount",
                "required": true,
                "minimum": 0
              }
            }
          }
        },
        "start_date": {
          "type": "string",
          "description": "Schedule start date in YYYY-MM-DD format; adds date column to each row",
          "required": false
        },
        "return_schedule": {
          "type": "boolean",
          "description": "Include schedule rows in response",
          "required": false,
          "default": true
        },
        "max_schedule_rows": {
          "type": "integer",
          "description": "Maximum amortization rows to return",
          "required": false,
          "default": 5000,
          "minimum": 1,
          "maximum": 50000
        },
        "store_schedule_file": {
          "type": "boolean",
          "description": "Upload schedule as CSV to cloud storage and return file metadata",
          "required": false,
          "default": false
        },
        "expiration_days": {
          "type": "integer",
          "description": "Cloud file expiration in days",
          "required": false,
          "default": 7,
          "minimum": 1,
          "maximum": 7
        }
      }
    },
    "compare_loans": {
      "description": "Compare multiple loan scenarios side-by-side and rank by selected metric (lowest payment, lowest interest, or lowest total cost).",
      "properties": {
        "compare_scenarios": {
          "type": "array",
          "description": "Loan scenarios to compare (minimum 2 required)",
          "required": true,
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "description": "Scenario label",
                "required": true
              },
              "principal": {
                "type": "number",
                "description": "Loan principal",
                "required": true,
                "minimum": 0
              },
              "annual_rate": {
                "type": "number",
                "description": "Annual rate in percent",
                "required": true,
                "minimum": 0,
                "maximum": 100
              },
              "years": {
                "type": "number",
                "description": "Term in years",
                "required": true,
                "minimum": 0,
                "maximum": 100
              },
              "payments_per_year": {
                "type": "integer",
                "description": "Payments per year",
                "required": false,
                "default": 12,
                "minimum": 1,
                "maximum": 365
              },
              "compounding_per_year": {
                "type": "integer",
                "description": "Compounding per year",
                "required": false,
                "default": 12,
                "minimum": 1,
                "maximum": 365
              },
              "extra_payment": {
                "type": "number",
                "description": "Recurring extra principal per payment",
                "required": false,
                "default": 0,
                "minimum": 0
              },
              "balloon_payment": {
                "type": "number",
                "description": "Balloon due at maturity",
                "required": false,
                "default": 0,
                "minimum": 0
              },
              "interest_only_periods": {
                "type": "integer",
                "description": "Interest-only period count",
                "required": false,
                "default": 0,
                "minimum": 0
              }
            }
          }
        },
        "comparison_metric": {
          "type": "string",
          "description": "How to rank scenarios",
          "required": false,
          "default": "lowest_total_cost",
          "enum": [
            "lowest_payment",
            "lowest_interest",
            "lowest_total_cost"
          ]
        }
      }
    },
    "affordability_analysis": {
      "description": "Estimate affordable monthly payment, maximum loan principal, and maximum home price based on income, debts, and DTI ratios.",
      "properties": {
        "annual_income": {
          "type": "number",
          "description": "Gross annual income",
          "required": true,
          "minimum": 0
        },
        "annual_rate": {
          "type": "number",
          "description": "Expected mortgage rate in percent",
          "required": true,
          "minimum": 0,
          "maximum": 100
        },
        "years": {
          "type": "number",
          "description": "Loan term in years",
          "required": true,
          "minimum": 0,
          "maximum": 100
        },
        "monthly_debts": {
          "type": "number",
          "description": "Recurring monthly debt obligations",
          "required": false,
          "default": 0,
          "minimum": 0
        },
        "monthly_expenses": {
          "type": "number",
          "description": "Additional recurring monthly expenses",
          "required": false,
          "default": 0,
          "minimum": 0
        },
        "front_end_ratio": {
          "type": "number",
          "description": "Maximum housing expense ratio to gross income",
          "required": false,
          "default": 0.28,
          "minimum": 0,
          "maximum": 1
        },
        "back_end_ratio": {
          "type": "number",
          "description": "Maximum total debt ratio to gross income",
          "required": false,
          "default": 0.36,
          "minimum": 0,
          "maximum": 1
        },
        "property_tax_monthly": {
          "type": "number",
          "description": "Estimated monthly property tax",
          "required": false,
          "default": 0,
          "minimum": 0
        },
        "insurance_monthly": {
          "type": "number",
          "description": "Estimated monthly insurance",
          "required": false,
          "default": 0,
          "minimum": 0
        },
        "hoa_monthly": {
          "type": "number",
          "description": "Estimated monthly HOA fees",
          "required": false,
          "default": 0,
          "minimum": 0
        },
        "down_payment": {
          "type": "number",
          "description": "Down payment amount (added to max principal for max home price)",
          "required": false,
          "default": 0,
          "minimum": 0
        },
        "payments_per_year": {
          "type": "integer",
          "description": "Payment frequency per year",
          "required": false,
          "default": 12,
          "minimum": 1,
          "maximum": 365
        },
        "compounding_per_year": {
          "type": "integer",
          "description": "Compounding frequency per year",
          "required": false,
          "default": 12,
          "minimum": 1,
          "maximum": 365
        }
      }
    },
    "refinance_break_even": {
      "description": "Estimate payment savings, break-even period, and net lifetime benefit of refinancing a loan.",
      "properties": {
        "current_balance": {
          "type": "number",
          "description": "Current remaining loan balance",
          "required": true,
          "minimum": 0
        },
        "current_rate": {
          "type": "number",
          "description": "Current annual interest rate in percent",
          "required": true,
          "minimum": 0,
          "maximum": 100
        },
        "current_remaining_term_months": {
          "type": "integer",
          "description": "Remaining months on current loan",
          "required": true,
          "minimum": 1,
          "maximum": 1200
        },
        "new_rate": {
          "type": "number",
          "description": "New annual interest rate in percent",
          "required": true,
          "minimum": 0,
          "maximum": 100
        },
        "new_term_months": {
          "type": "integer",
          "description": "New loan term in months",
          "required": true,
          "minimum": 1,
          "maximum": 1200
        },
        "closing_costs": {
          "type": "number",
          "description": "Refinance closing costs",
          "required": true,
          "minimum": 0
        },
        "current_payment": {
          "type": "number",
          "description": "Current monthly payment (if omitted, calculated automatically from balance/rate/term)",
          "required": false,
          "minimum": 0
        }
      }
    },
    "payoff_acceleration": {
      "description": "Model interest and term savings from recurring and one-time extra payments by comparing baseline vs accelerated payoff scenarios.",
      "properties": {
        "principal": {
          "type": "number",
          "description": "Loan principal",
          "required": true,
          "minimum": 0
        },
        "annual_rate": {
          "type": "number",
          "description": "Nominal annual interest rate in percent",
          "required": true,
          "minimum": 0,
          "maximum": 100
        },
        "years": {
          "type": "number",
          "description": "Original loan term in years",
          "required": true,
          "minimum": 0,
          "maximum": 100
        },
        "payments_per_year": {
          "type": "integer",
          "description": "Payment frequency per year",
          "required": false,
          "default": 12,
          "minimum": 1,
          "maximum": 365
        },
        "compounding_per_year": {
          "type": "integer",
          "description": "Compounding frequency per year",
          "required": false,
          "default": 12,
          "minimum": 1,
          "maximum": 365
        },
        "extra_payment": {
          "type": "number",
          "description": "Recurring extra principal each period",
          "required": false,
          "default": 0,
          "minimum": 0
        },
        "extra_payment_start_period": {
          "type": "integer",
          "description": "Period to begin recurring extra payments",
          "required": false,
          "default": 1,
          "minimum": 1
        },
        "one_time_extra_payments": {
          "type": "array",
          "description": "One-time extra payments",
          "required": false,
          "items": {
            "type": "object",
            "properties": {
              "period": {
                "type": "integer",
                "description": "Payment period index (1-based)",
                "required": true,
                "minimum": 1
              },
              "amount": {
                "type": "number",
                "description": "Extra principal payment amount",
                "required": true,
                "minimum": 0
              }
            }
          }
        },
        "future_value": {
          "type": "number",
          "description": "Target future value",
          "required": false,
          "default": 0,
          "minimum": 0
        },
        "balloon_payment": {
          "type": "number",
          "description": "Balloon due at maturity",
          "required": false,
          "default": 0,
          "minimum": 0
        },
        "interest_only_periods": {
          "type": "integer",
          "description": "Interest-only period count",
          "required": false,
          "default": 0,
          "minimum": 0
        },
        "start_date": {
          "type": "string",
          "description": "Optional start date in YYYY-MM-DD format",
          "required": false
        }
      }
    },
    "rate_conversion": {
      "description": "Convert a nominal annual percentage rate (APR) into effective annual, payment-period, and daily effective rates.",
      "properties": {
        "annual_rate": {
          "type": "number",
          "description": "Nominal annual interest rate in percent",
          "required": true,
          "minimum": 0,
          "maximum": 100
        },
        "compounding_per_year": {
          "type": "integer",
          "description": "Compounding frequency per year",
          "required": false,
          "default": 12,
          "minimum": 1,
          "maximum": 365
        },
        "payments_per_year": {
          "type": "integer",
          "description": "Payment frequency per year",
          "required": false,
          "default": 12,
          "minimum": 1,
          "maximum": 365
        }
      }
    }
  },
  "properties": {
    "action": {
      "type": "string",
      "description": "Action to perform",
      "required": true,
      "default": "calculate_payment",
      "enum": [
        "get_instructions",
        "calculate_payment",
        "calculate_loan_principal",
        "calculate_term",
        "simple_interest",
        "compound_interest",
        "amortization_schedule",
        "compare_loans",
        "affordability_analysis",
        "refinance_break_even",
        "payoff_acceleration",
        "rate_conversion"
      ]
    },
    "principal": {
      "type": "number",
      "description": "Principal or present value",
      "required": false,
      "minimum": 0
    },
    "annual_rate": {
      "type": "number",
      "description": "Nominal annual interest rate in percent",
      "required": false,
      "minimum": 0,
      "maximum": 100
    },
    "years": {
      "type": "number",
      "description": "Loan term in years",
      "required": false,
      "minimum": 0
    },
    "payments_per_year": {
      "type": "integer",
      "description": "Payment frequency per year",
      "required": false,
      "default": 12,
      "minimum": 1,
      "maximum": 365
    },
    "compounding_per_year": {
      "type": "integer",
      "description": "Compounding frequency per year",
      "required": false,
      "default": 12,
      "minimum": 1,
      "maximum": 365
    },
    "payment_amount": {
      "type": "number",
      "description": "Periodic payment amount",
      "required": false,
      "minimum": 0
    },
    "target_periods": {
      "type": "integer",
      "description": "Target number of payment periods",
      "required": false,
      "minimum": 1
    },
    "future_value": {
      "type": "number",
      "description": "Target future value",
      "required": false,
      "minimum": 0
    },
    "balloon_payment": {
      "type": "number",
      "description": "Balloon due at maturity",
      "required": false,
      "minimum": 0
    },
    "interest_only_periods": {
      "type": "integer",
      "description": "Interest-only period count",
      "required": false,
      "minimum": 0
    },
    "extra_payment": {
      "type": "number",
      "description": "Recurring extra principal amount",
      "required": false,
      "minimum": 0
    },
    "extra_payment_start_period": {
      "type": "integer",
      "description": "Period to begin recurring extra payment",
      "required": false,
      "default": 1,
      "minimum": 1
    },
    "one_time_extra_payments": {
      "type": "array",
      "description": "One-time extra principal payments",
      "required": false,
      "items": {
        "type": "object",
        "properties": {
          "period": {
            "type": "integer",
            "minimum": 1
          },
          "amount": {
            "type": "number",
            "minimum": 0
          }
        },
        "required": [
          "period",
          "amount"
        ]
      }
    },
    "start_date": {
      "type": "string",
      "description": "Optional schedule start date in YYYY-MM-DD format",
      "required": false
    },
    "return_schedule": {
      "type": "boolean",
      "description": "Include schedule rows in response",
      "required": false,
      "default": true
    },
    "store_schedule_file": {
      "type": "boolean",
      "description": "Upload schedule CSV and return file metadata",
      "required": false
    },
    "max_schedule_rows": {
      "type": "integer",
      "description": "Maximum amortization rows to return",
      "required": false,
      "default": 5000,
      "minimum": 1,
      "maximum": 50000
    },
    "expiration_days": {
      "type": "integer",
      "description": "Cloud file expiration in days",
      "required": false,
      "default": 7,
      "minimum": 1,
      "maximum": 7
    },
    "periodic_contribution": {
      "type": "number",
      "description": "Contribution amount for compound interest projections",
      "required": false,
      "minimum": 0
    },
    "contribution_frequency_per_year": {
      "type": "integer",
      "description": "Contribution frequency per year",
      "required": false,
      "default": 12,
      "minimum": 1,
      "maximum": 365
    },
    "contribution_timing": {
      "type": "string",
      "description": "Contribution timing",
      "required": false,
      "default": "end",
      "enum": [
        "end",
        "beginning"
      ]
    },
    "compare_scenarios": {
      "type": "array",
      "description": "Scenarios for compare_loans",
      "required": false,
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "principal": {
            "type": "number",
            "minimum": 0
          },
          "annual_rate": {
            "type": "number",
            "minimum": 0,
            "maximum": 100
          },
          "years": {
            "type": "number",
            "minimum": 0
          },
          "payments_per_year": {
            "type": "integer",
            "minimum": 1,
            "maximum": 365
          },
          "compounding_per_year": {
            "type": "integer",
            "minimum": 1,
            "maximum": 365
          },
          "extra_payment": {
            "type": "number",
            "minimum": 0
          },
          "balloon_payment": {
            "type": "number",
            "minimum": 0
          },
          "interest_only_periods": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "name",
          "principal",
          "annual_rate",
          "years"
        ]
      }
    },
    "comparison_metric": {
      "type": "string",
      "description": "Scenario ranking method",
      "required": false,
      "default": "lowest_total_cost",
      "enum": [
        "lowest_payment",
        "lowest_interest",
        "lowest_total_cost"
      ]
    },
    "annual_income": {
      "type": "number",
      "description": "Gross annual income",
      "required": false,
      "minimum": 0
    },
    "monthly_debts": {
      "type": "number",
      "description": "Recurring monthly debt obligations",
      "required": false,
      "minimum": 0
    },
    "monthly_expenses": {
      "type": "number",
      "description": "Additional recurring monthly expenses",
      "required": false,
      "minimum": 0
    },
    "front_end_ratio": {
      "type": "number",
      "description": "Housing ratio against gross income",
      "required": false,
      "default": 0.28,
      "minimum": 0,
      "maximum": 1
    },
    "back_end_ratio": {
      "type": "number",
      "description": "Total debt ratio against gross income",
      "required": false,
      "default": 0.36,
      "minimum": 0,
      "maximum": 1
    },
    "property_tax_monthly": {
      "type": "number",
      "description": "Monthly property tax",
      "required": false,
      "minimum": 0
    },
    "insurance_monthly": {
      "type": "number",
      "description": "Monthly insurance",
      "required": false,
      "minimum": 0
    },
    "hoa_monthly": {
      "type": "number",
      "description": "Monthly HOA fees",
      "required": false,
      "minimum": 0
    },
    "down_payment": {
      "type": "number",
      "description": "Down payment amount",
      "required": false,
      "minimum": 0
    },
    "current_balance": {
      "type": "number",
      "description": "Current loan balance for refinance",
      "required": false,
      "minimum": 0
    },
    "current_rate": {
      "type": "number",
      "description": "Current interest rate for refinance",
      "required": false,
      "minimum": 0,
      "maximum": 100
    },
    "current_remaining_term_months": {
      "type": "integer",
      "description": "Remaining months on current loan",
      "required": false,
      "minimum": 1
    },
    "current_payment": {
      "type": "number",
      "description": "Current monthly payment",
      "required": false,
      "minimum": 0
    },
    "new_rate": {
      "type": "number",
      "description": "New interest rate for refinance",
      "required": false,
      "minimum": 0,
      "maximum": 100
    },
    "new_term_months": {
      "type": "integer",
      "description": "New loan term in months for refinance",
      "required": false,
      "minimum": 1
    },
    "closing_costs": {
      "type": "number",
      "description": "Refinance closing costs",
      "required": false,
      "minimum": 0
    }
  }
}
```

### Usage Instructions

# Financial Loan Calculator - Tool Instructions

## Overview
Comprehensive financial loan calculator supporting mortgage, auto, and personal loan calculations. Provides 11 actions covering payment computation, principal calculation, term determination, simple and compound interest, full amortization schedules with CSV export, multi-scenario loan comparison, home affordability analysis, refinance break-even analysis, payoff acceleration modeling, and interest rate conversion. All calculations support configurable payment and compounding frequencies, interest-only periods, balloon payments, and extra payments.

---

## Actions

### calculate_payment
Compute the periodic payment for an amortizing loan. Supports interest-only periods and balloon payments.

**Required Parameters:**
- `action` (string): `"calculate_payment"`
- `principal` (number, >0): Loan principal amount
- `annual_rate` (number, 0-100): Nominal annual interest rate in percent
- `years` (number, >0): Loan term in years

**Optional Parameters:**
- `payments_per_year` (integer, default: 12, range: 1-365): Payment frequency per year
- `compounding_per_year` (integer, default: 12, range: 1-365): Compounding frequency per year
- `future_value` (number, default: 0): Target future value after final payment
- `balloon_payment` (number, default: 0): Balloon amount due at maturity
- `interest_only_periods` (integer, default: 0): Number of interest-only payment periods at the start

**Example:**
```json
{
  "action": "calculate_payment",
  "principal": 350000,
  "annual_rate": 6.25,
  "years": 30,
  "payments_per_year": 12,
  "compounding_per_year": 12
}
```

**Response fields:** `payment_per_period`, `interest_only_payment_per_period`, `periodic_rate_percent`, `total_periods`, `amortizing_periods`

---

### calculate_loan_principal
Calculate the maximum loan principal supported by a given payment amount.

**Required Parameters:**
- `action` (string): `"calculate_loan_principal"`
- `payment_amount` (number, >0): Periodic payment amount
- `annual_rate` (number, 0-100): Nominal annual interest rate in percent
- `years` (number, >0) or `target_periods` (integer, >=1): Loan term (one or both required)

**Optional Parameters:**
- `payments_per_year` (integer, default: 12)
- `compounding_per_year` (integer, default: 12)
- `future_value` (number, default: 0)
- `balloon_payment` (number, default: 0)

**Example:**
```json
{
  "action": "calculate_loan_principal",
  "payment_amount": 2200,
  "annual_rate": 6.1,
  "years": 30
}
```

**Response fields:** `max_principal`, `periods`, `periodic_rate_percent`

---

### calculate_term
Calculate the number of periods required to pay off a loan given principal, rate, and payment.

**Required Parameters:**
- `action` (string): `"calculate_term"`
- `principal` (number, >0): Loan principal
- `annual_rate` (number, 0-100): Nominal annual rate in percent
- `payment_amount` (number, >0): Periodic payment amount

**Optional Parameters:**
- `payments_per_year` (integer, default: 12)
- `compounding_per_year` (integer, default: 12)

**Example:**
```json
{
  "action": "calculate_term",
  "principal": 42000,
  "annual_rate": 7.9,
  "payment_amount": 850
}
```

**Response fields:** `required_periods`, `required_years`, `periodic_rate_percent`

Note: Returns an error if the payment amount is too low to amortize the loan (i.e., less than or equal to the interest-only payment).

---

### simple_interest
Calculate simple (non-compounded) interest totals.

**Required Parameters:**
- `action` (string): `"simple_interest"`
- `principal` (number, >0): Principal amount
- `annual_rate` (number, 0-100): Annual interest rate in percent
- `years` (number, >0): Duration in years

**Example:**
```json
{
  "action": "simple_interest",
  "principal": 10000,
  "annual_rate": 5,
  "years": 3
}
```

**Response fields:** `principal`, `interest`, `total_amount`, `annual_rate_percent`, `years`

---

### compound_interest
Calculate compound interest growth, optionally with periodic contributions.

**Required Parameters:**
- `action` (string): `"compound_interest"`
- `principal` (number, >0): Initial principal amount
- `annual_rate` (number, 0-100): Annual interest rate in percent
- `years` (number, >0): Investment duration in years

**Optional Parameters:**
- `compounding_per_year` (integer, default: 12): Compounding frequency
- `periodic_contribution` (number, default: 0): Amount added each contribution period
- `contribution_frequency_per_year` (integer, default: 12, range: 1-365): How often contributions are made
- `contribution_timing` (string, default: `"end"`): `"end"` or `"beginning"` of each period

**Example:**
```json
{
  "action": "compound_interest",
  "principal": 15000,
  "annual_rate": 7,
  "years": 10,
  "compounding_per_year": 12,
  "periodic_contribution": 300,
  "contribution_frequency_per_year": 12,
  "contribution_timing": "end"
}
```

**Response fields:** `future_value`, `principal_growth_component`, `contribution_growth_component`, `total_contributions`, `interest_earned`, `effective_annual_rate_percent`, `contribution_rate_percent`

---

### amortization_schedule
Build a full amortization table with support for extra payments and optional CSV file export.

**Required Parameters:**
- `action` (string): `"amortization_schedule"`
- `principal` (number, >0): Loan principal
- `annual_rate` (number, 0-100): Nominal annual rate in percent
- `years` (number, >0): Loan term in years

**Optional Parameters:**
- `payments_per_year` (integer, default: 12)
- `compounding_per_year` (integer, default: 12)
- `future_value` (number, default: 0)
- `balloon_payment` (number, default: 0)
- `interest_only_periods` (integer, default: 0)
- `extra_payment` (number, default: 0): Recurring extra principal each period
- `extra_payment_start_period` (integer, default: 1): Period to begin recurring extra payments
- `one_time_extra_payments` (array): List of one-time extra payments, each with `period` (integer, >=1) and `amount` (number, >0)
- `start_date` (string): Schedule start date in `YYYY-MM-DD` format; adds date column to each row
- `return_schedule` (boolean, default: true): Include schedule rows in response
- `max_schedule_rows` (integer, default: 5000, range: 1-50000): Maximum rows to return
- `store_schedule_file` (boolean, default: false): Upload schedule as CSV to cloud storage
- `expiration_days` (integer, default: 7, range: 1-7): Cloud file expiration in days

**Example:**
```json
{
  "action": "amortization_schedule",
  "principal": 280000,
  "annual_rate": 6.4,
  "years": 30,
  "extra_payment": 200,
  "store_schedule_file": true,
  "expiration_days": 7
}
```

**Response fields:** `summary` (object with principal, rates, periods, payment, totals, paid_off_early flag), `schedule` (array of period rows with payment/principal/interest/extra_payment/balance/cumulative fields), `schedule_truncated` (boolean). When `store_schedule_file` is true: `schedule_file` with `file_id`, `signed_url`, `expiration_date`, `size_bytes`.

Each schedule row contains: `period`, `date` (if start_date provided), `payment`, `principal`, `interest`, `extra_payment`, `balance`, `cumulative_interest`, `cumulative_paid`.

---

### compare_loans
Compare multiple loan scenarios side-by-side and rank by a selected metric.

**Required Parameters:**
- `action` (string): `"compare_loans"`
- `compare_scenarios` (array, minimum 2 items): Each scenario object requires:
  - `name` (string): Scenario label
  - `principal` (number, >0): Loan principal
  - `annual_rate` (number, 0-100): Annual rate in percent
  - `years` (number, >0): Term in years

**Optional per-scenario fields:** `payments_per_year` (default: 12), `compounding_per_year` (default: 12), `extra_payment` (default: 0), `balloon_payment` (default: 0), `interest_only_periods` (default: 0)

**Optional Parameters:**
- `comparison_metric` (string, default: `"lowest_total_cost"`): Ranking method. One of: `"lowest_payment"`, `"lowest_interest"`, `"lowest_total_cost"`

**Example:**
```json
{
  "action": "compare_loans",
  "comparison_metric": "lowest_total_cost",
  "compare_scenarios": [
    {"name": "30Y Fixed", "principal": 320000, "annual_rate": 6.5, "years": 30},
    {"name": "15Y Fixed", "principal": 320000, "annual_rate": 5.8, "years": 15}
  ]
}
```

**Response fields:** `comparison_metric`, `ranked_scenarios` (array sorted by metric, each with name/principal/annual_rate_percent/years/payment_per_period/total_interest/total_paid/actual_periods), `best_scenario`

---

### affordability_analysis
Estimate affordable monthly payment, maximum loan principal, and maximum home price based on income and debts.

**Required Parameters:**
- `action` (string): `"affordability_analysis"`
- `annual_income` (number, >0): Gross annual income
- `annual_rate` (number, 0-100): Expected mortgage rate in percent
- `years` (number, >0): Loan term in years

**Optional Parameters:**
- `monthly_debts` (number, default: 0): Recurring monthly debt obligations
- `monthly_expenses` (number, default: 0): Additional recurring monthly expenses
- `front_end_ratio` (number, default: 0.28, range: 0-1): Maximum housing expense ratio
- `back_end_ratio` (number, default: 0.36, range: 0-1): Maximum total debt ratio
- `property_tax_monthly` (number, default: 0)
- `insurance_monthly` (number, default: 0)
- `hoa_monthly` (number, default: 0)
- `down_payment` (number, default: 0): Down payment amount (added to max principal for max home price)
- `payments_per_year` (integer, default: 12)
- `compounding_per_year` (integer, default: 12)

**Example:**
```json
{
  "action": "affordability_analysis",
  "annual_income": 145000,
  "monthly_debts": 850,
  "annual_rate": 6.2,
  "years": 30,
  "down_payment": 60000
}
```

**Response fields:** `monthly_income`, `front_end_limit`, `back_end_limit`, `gross_housing_budget`, `net_housing_budget_for_pi`, `max_loan_principal`, `max_home_price_with_down_payment`, `assumptions`

Note: Returns an error if deductions (taxes, insurance, HOA, expenses) exceed the available housing budget.

---

### refinance_break_even
Estimate payment savings, break-even period, and net lifetime benefit of refinancing.

**Required Parameters:**
- `action` (string): `"refinance_break_even"`
- `current_balance` (number, >0): Current remaining loan balance
- `current_rate` (number, 0-100): Current annual rate in percent
- `current_remaining_term_months` (integer, >=1): Remaining months on current loan
- `new_rate` (number, 0-100): New annual rate in percent
- `new_term_months` (integer, >=1): New loan term in months
- `closing_costs` (number, >=0): Refinance closing costs

**Optional Parameters:**
- `current_payment` (number, >0): Current monthly payment. If omitted, calculated automatically from balance/rate/term.

**Example:**
```json
{
  "action": "refinance_break_even",
  "current_balance": 295000,
  "current_rate": 7.1,
  "current_remaining_term_months": 312,
  "new_rate": 6.1,
  "new_term_months": 360,
  "closing_costs": 5500
}
```

**Response fields:** `current_payment`, `new_payment`, `monthly_savings`, `closing_costs`, `break_even_months`, `current_remaining_interest`, `new_total_interest`, `interest_savings`, `lifetime_net_benefit_after_costs`, `recommendation` (`"favorable"` or `"not_favorable"`)

The recommendation is `"favorable"` when break-even occurs within the remaining term and the lifetime net benefit is positive.

---

### payoff_acceleration
Model interest and term savings from recurring and one-time extra payments by comparing baseline vs accelerated scenarios.

**Required Parameters:**
- `action` (string): `"payoff_acceleration"`
- `principal` (number, >0): Loan principal
- `annual_rate` (number, 0-100): Nominal annual rate in percent
- `years` (number, >0): Original loan term in years

**Optional Parameters:**
- `payments_per_year` (integer, default: 12)
- `compounding_per_year` (integer, default: 12)
- `extra_payment` (number, default: 0): Recurring extra principal each period
- `extra_payment_start_period` (integer, default: 1): Period to begin extra payments
- `one_time_extra_payments` (array): One-time extra payments, each with `period` and `amount`
- `future_value` (number, default: 0)
- `balloon_payment` (number, default: 0)
- `interest_only_periods` (integer, default: 0)
- `start_date` (string): Optional start date in `YYYY-MM-DD`

**Example:**
```json
{
  "action": "payoff_acceleration",
  "principal": 250000,
  "annual_rate": 6.0,
  "years": 30,
  "extra_payment": 300,
  "one_time_extra_payments": [{"period": 24, "amount": 5000}]
}
```

**Response fields:** `baseline` (summary without extra payments), `accelerated` (summary with extra payments), `periods_saved`, `years_saved`, `interest_saved`

---

### rate_conversion
Convert a nominal annual percentage rate (APR) into effective annual and payment-period rates.

**Required Parameters:**
- `action` (string): `"rate_conversion"`
- `annual_rate` (number, 0-100): Nominal annual rate in percent

**Optional Parameters:**
- `compounding_per_year` (integer, default: 12): Compounding frequency
- `payments_per_year` (integer, default: 12): Payment frequency

**Example:**
```json
{
  "action": "rate_conversion",
  "annual_rate": 8.0,
  "compounding_per_year": 12,
  "payments_per_year": 26
}
```

**Response fields:** `nominal_annual_rate_percent`, `effective_annual_rate_percent`, `payment_period_rate_percent`, `daily_effective_rate_percent`, `assumptions`

---

## Workflows

1. **Home Purchase Planning** - Use `affordability_analysis` to determine budget, then `calculate_payment` to see exact payments, then `amortization_schedule` with `store_schedule_file: true` for a downloadable payment plan.
2. **Loan Comparison Shopping** - Use `compare_loans` with multiple scenarios (e.g., 15Y vs 30Y, different rates) ranked by `lowest_total_cost` or `lowest_payment`.
3. **Refinance Decision** - Use `refinance_break_even` to see if refinancing makes sense, check `recommendation` field and `break_even_months`.
4. **Early Payoff Strategy** - Use `payoff_acceleration` to model the impact of extra payments on term and interest savings.
5. **Investment Growth Projection** - Use `compound_interest` with `periodic_contribution` to project savings/investment growth over time.
6. **Rate Analysis** - Use `rate_conversion` to compare APR vs effective rates across different compounding frequencies.

---

## Notes

- All monetary results are rounded to 2 decimal places. Rate percentages are rounded to 6 decimal places.
- The `interest_only_periods` value must be less than the total number of payment periods.
- When `compounding_per_year` differs from `payments_per_year`, the tool correctly converts the nominal rate to the appropriate periodic rate using the effective rate method.
- Amortization schedules can be very large. Use `max_schedule_rows` to cap output size (default 5000, max 50000). If truncated, `schedule_truncated` is true.
- Set `return_schedule: false` to get only the summary without period-by-period rows.
- CSV file uploads via `store_schedule_file` expire in 1-7 days (configurable via `expiration_days`).
- The `calculate_term` action will error if the payment is too low to amortize the loan (payment <= interest-only amount).
- For `refinance_break_even`, if `current_payment` is not provided, it is automatically calculated from the current balance, rate, and remaining term.
- The `compare_loans` action requires at least 2 scenarios.
- All date fields use `YYYY-MM-DD` format. Invalid formats return a validation error.

### Frequently Asked Questions

No linked FAQs are currently available.

### Dependencies

This product has no public dependency products.