exponential
Calculate exponential function values (e^x) for mathematical and financial computations within the MCP Calc Tools server.
Instructions
Calculate exponential function (e^x)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| power | Yes |
Implementation Reference
- index.js:199-201 (handler)The handler function executes the core logic of the 'exponential' tool by computing e^power using JavaScript's Math.exp().async ({ power }) => { return Math.exp(power); }
- index.js:191-198 (schema)Schema defines the tool metadata, input (power as number), and output (number) using Zod validation.{ name: 'exponential', description: 'Calculate exponential function (e^x)', inputSchema: z.object({ power: z.number() }), outputSchema: z.number(), },
- index.js:190-202 (registration)Registers the 'exponential' tool with Genkit's ai.defineTool, linking schema and handler.ai.defineTool( { name: 'exponential', description: 'Calculate exponential function (e^x)', inputSchema: z.object({ power: z.number() }), outputSchema: z.number(), }, async ({ power }) => { return Math.exp(power); } );