Skip to main content
Glama
tech-sushant

Calculator MCP Server

by tech-sushant

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
baseYesBase number
exponentYesExponent

Implementation Reference

  • 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"], }, },
  • 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"], },
Install Server

Other Tools

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/tech-sushant/calculator-mcp'

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