Skip to main content
Glama

power

Calculate exponential values by raising a base number to a specified power using mathematical exponentiation.

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
NameRequiredDescriptionDefault
baseYes
exponentYes

Implementation Reference

  • The main handler function for the 'power' tool. It takes base and exponent as floats and returns base raised to the power of exponent using math.pow.
    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)
  • server.py:91-91 (registration)
    The @mcp.tool() decorator registers the power function as an MCP tool with the name 'power' derived from the function name.
    @mcp.tool()
  • The docstring provides the description, input parameters (base, exponent), and return value description, which FastMCP uses to generate the tool's JSON schema.
    """ 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) """

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/xiaoyuchenhot/MCP-example'

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