power
Calculate exponentiation by raising a base number to a specified exponent power. Use this tool to perform mathematical power operations within the Calculator MCP Server.
Instructions
Raise first number to the power of second number
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"base": "<base>",
"exponent": "<exponent>"
},
"name": "power"
}
}Input 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.
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:92-109 (registration)Registration of the 'power' tool in listTools handler, 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"], }, }, - src/index.ts:95-108 (schema)Input schema for the '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"], },