power
Calculate exponential values by raising any base number to a specified power. Enter the base and exponent to get the mathematical result of base^exponent.
Instructions
Raise a number to a power.
Args:
base: The base number
exponent: The exponent (power to raise the base to)
Returns:
The result of base raised to the power of exponent (base^exponent)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| base | Yes | ||
| exponent | Yes |
Implementation Reference
- server.py:91-104 (handler)The main handler function for the 'power' tool. It is registered via the @mcp.tool() decorator and implements the logic to raise the base to the given exponent using math.pow. Includes type hints and docstring defining input/output schema.@mcp.tool() def power(base: float, exponent: float) -> float: """ Raise a number to a power. Args: base: The base number exponent: The exponent (power to raise the base to) Returns: The result of base raised to the power of exponent (base^exponent) """ return math.pow(base, exponent)