mcp-calculator mcp

v1.0.0 · MCP Tool · registry.pascalai.org

Evaluate mathematical expressions with precision. Supports arithmetic, algebra, trigonometry, unit conversions, statistics and complex numbers. Never attempt mental arithmetic — use this tool.

Input Parameters

ParameterTypeDescription
expressionrequired string Math expression to evaluate: '2^10', 'sin(PI/4)', 'mean([1,2,3])', '15 kg in lb'.
precisionoptional integer Decimal places in result. Default: 10, max: 50.
variablesoptional object Named variables to substitute into the expression: {"x": 5, "y": 3}.

Output Fields

FieldTypeDescription
result string Result as string, preserving full precision.
numeric number Numeric (floating-point) representation of the result.
expression string Normalized form of the input expression.
unit string Result unit when a unit conversion was performed.
steps array Intermediate computation steps for complex expressions.

Example

// Input — compound interest
{ "expression": "1000 * (1 + 0.07)^20", "precision": 2 }

// Output
{ "result": "3869.68", "numeric": 3869.68, "expression": "1000*(1.07)^20" }

// Input — unit conversion
{ "expression": "100 mph in km/h" }

// Output
{ "result": "160.9344", "unit": "km/h" }

Install & Discovery

Install

ppm install mcp-calculator

Get JSON Schema

GET /v1/packages/mcp-calculator/1.0.0/schema

Discover by keyword

GET /v1/mcp/discover?q=calculator
Discovery hint: Use this tool for any numerical computation, unit conversion, or statistical calculation. Never perform mental arithmetic in an agent — delegate to this tool for accuracy and precision.

PascalAI Usage

uses toolslib;

var
  Calc := LoadTool('mcp-calculator');

  // Financial calculation
  var Principal := Calc.Call(JsonObj(['expression', '50000 * (1 + 0.085)^10', 'precision', 2]));
  Writeln('Future value: $' + Principal['result']);

  // Statistics
  var Stats := Calc.Call(JsonObj(['expression', 'stdev([12, 15, 18, 14, 17, 19, 13])']));
  Writeln('Std deviation: ' + Stats['result']);