Skip to main content
Glama

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
NameRequiredDescriptionDefault
futureValueYes
rateYes
timeYes

Implementation Reference

  • 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); }
  • 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); } );

Other Tools

Related 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/nbiish/mcp-calc-tools'

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