future_value
Calculate future value of present amount using interest rate and time periods for financial planning and investment analysis.
Instructions
Calculate future value of present amount
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| periods | Yes | ||
| presentValue | Yes | ||
| rate | Yes |
Implementation Reference
- src/tools/financial-tools.ts:528-555 (registration)Tool registration object defining name, description, inputSchema, and handler for the 'future_value' tool within the financialTools array.{ name: "future_value", description: "Calculate future value of present amount", inputSchema: { type: "object", properties: { presentValue: { type: "number" }, rate: { type: "number" }, periods: { type: "number" } }, required: ["presentValue", "rate", "periods"] }, handler: async (args: any): Promise<ToolResult> => { try { const result = await pythonBridge.callPythonFunction({ module: 'financial_calculations', function: 'FinancialCalculator.future_value', args: [args.presentValue, args.rate, args.periods] }); return result; } catch (error) { return { success: false, error: error instanceof Error ? error.message : String(error) }; } } },
- src/tools/financial-tools.ts:540-554 (handler)The handler function that bridges to the Python implementation for executing the future_value calculation.handler: async (args: any): Promise<ToolResult> => { try { const result = await pythonBridge.callPythonFunction({ module: 'financial_calculations', function: 'FinancialCalculator.future_value', args: [args.presentValue, args.rate, args.periods] }); return result; } catch (error) { return { success: false, error: error instanceof Error ? error.message : String(error) }; } }
- src/tools/financial-tools.ts:531-539 (schema)Input schema specifying the required parameters: presentValue, rate, and periods.inputSchema: { type: "object", properties: { presentValue: { type: "number" }, rate: { type: "number" }, periods: { type: "number" } }, required: ["presentValue", "rate", "periods"] },
- The core Python helper function implementing the future value formula: FV = PV * (1 + r)^n.def future_value(present_value: float, rate: float, periods: int) -> float: """Calculate future value""" return present_value * ((1 + rate) ** periods)