power
Calculate exponential values by raising a base number to any exponent power for mathematical operations and scientific calculations.
Instructions
Raise first number to the power of second number
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| base | Yes | Base number | |
| exponent | Yes | Exponent |
Implementation Reference
- src/index.ts:197-208 (handler)Handler for the 'power' tool: extracts base and exponent from arguments, computes Math.pow(base, exponent), and returns formatted result text.case "power": { const { base, exponent } = args as { base: number; exponent: number }; const result = Math.pow(base, exponent); return { content: [ { type: "text", text: `${base}^${exponent} = ${result}`, }, ], }; }
- src/index.ts:95-108 (schema)Input schema for 'power' tool defining base and exponent as required number properties.inputSchema: { type: "object", properties: { base: { type: "number", description: "Base number", }, exponent: { type: "number", description: "Exponent", }, }, required: ["base", "exponent"], },
- src/index.ts:92-109 (registration)Registration of 'power' tool in ListTools response, including name, description, and input schema.{ name: "power", description: "Raise first number to the power of second number", inputSchema: { type: "object", properties: { base: { type: "number", description: "Base number", }, exponent: { type: "number", description: "Exponent", }, }, required: ["base", "exponent"], }, },