present_value
Determine the current worth of future cash flows by inputting future value, rate, and time. Ideal for financial planning and investment analysis.
Instructions
Calculate present value of future cash flows
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| futureValue | Yes | ||
| rate | Yes | ||
| time | Yes |
Implementation Reference
- index.js:233-235 (handler)The handler function for the 'present_value' tool, which computes the present value of a future amount using the formula: futureValue / (1 + rate)^time.async ({ futureValue, rate, time }) => { return futureValue / Math.pow(1 + rate, time); }
- index.js:224-232 (schema)Schema definition including input parameters (futureValue, rate, time) and output type (number) for the 'present_value' tool.name: 'present_value', description: 'Calculate present value of future cash flows', inputSchema: z.object({ futureValue: z.number(), rate: z.number(), // discount rate as decimal time: z.number() // years }), outputSchema: z.number(), },
- index.js:222-236 (registration)Registration of the 'present_value' tool via ai.defineTool, including schema and inline handler implementation.ai.defineTool( { name: 'present_value', description: 'Calculate present value of future cash flows', inputSchema: z.object({ futureValue: z.number(), rate: z.number(), // discount rate as decimal time: z.number() // years }), outputSchema: z.number(), }, async ({ futureValue, rate, time }) => { return futureValue / Math.pow(1 + rate, time); } );