API Reference
MCP Math Server
Deterministic tools for mathematical evaluations, statistics, quadratic solving, number theory, permutations, geometry, trigonometry, and full MCP Math Server integration for AI agents.
math_evaluate
math_percentage
math_statistics
math_quadratic
math_gcd_lcm
math_prime_factors
math_power_root
math_permutations_combinations
math_simplify_fraction
math_geometry
math_trigonometry
math_logarithm
Arithmetic & Algebra
math_evaluate
Safely evaluate mathematical expressions including arithmetic, exponents, parentheses, and percentages.
mcp toolevaluation
| Parameter | Type | Required | Description |
|---|---|---|---|
expression | string | required | Mathematical string (e.g., "(12 + 8) * 3 / 2" or "2^10") |
Safe Expression Evaluator
Rejects non-mathematical syntax and code execution attempts. Automatically converts ^ to exponentiation and handles modulo/percentages safely.
Request / Response
// Request { "expression": "(12 + 8) * 3 / 2" } // Response { "expression": "(12 + 8) * 3 / 2", "result": 30 }
math_percentage
Perform common percentage operations including relative value, percentage change, and percentage difference.
mcp toolpercentage
| Parameter | Type | Required | Description |
|---|---|---|---|
mode | enum | required | percentage_of · what_percent_is · percentage_change · percentage_difference |
a | number | required | First operand (e.g., percentage rate or initial value) |
b | number | required | Second operand (e.g., total value or target value) |
Request / Response
// Calculate 20% of 150 { "mode": "percentage_of", "a": 20, "b": 150 } { "mode": "percentage_of", "a": 20, "b": 150, "result": 30 }
math_quadratic
Solve quadratic equations ax² + bx + c = 0 and calculate discriminant and real or complex roots.
mcp toolalgebra
| Parameter | Type | Required | Description |
|---|---|---|---|
a | number | required | Coefficient for x² (must not be zero) |
b | number | required | Coefficient for x |
c | number | required | Constant term |
Request / Response
{ "a": 1, "b": -5, "c": 6 } { "a": 1, "b": -5, "c": 6, "discriminant": 1, "rootType": "two_real", "roots": [3, 2] }
math_simplify_fraction
Reduce fractions to lowest terms, formatting mixed fractions and precise decimals.
mcp toolfractions
| Parameter | Type | Required | Description |
|---|---|---|---|
numerator | integer | required | Fraction numerator |
denominator | integer | required | Fraction denominator (must not be zero) |
Request / Response
{ "numerator": 42, "denominator": 56 } { "original": "42/56", "simplified": "3/4", "mixedFraction": "3/4", "decimal": 0.75 }
Number Theory & Discrete
math_gcd_lcm
Calculate the Greatest Common Divisor (GCD) and Least Common Multiple (LCM) for two numbers.
mcp toolnumber theory
| Parameter | Type | Required | Description |
|---|---|---|---|
a | integer | required | First integer |
b | integer | required | Second integer |
Request / Response
{ "a": 12, "b": 18 } { "a": 12, "b": 18, "gcd": 6, "lcm": 36 }
math_prime_factors
Find complete prime factorization and evaluate primality for an integer.
mcp toolnumber theory
| Parameter | Type | Required | Description |
|---|---|---|---|
number | integer | required | Integer greater than 1 |
Request / Response
{ "number": 84 } { "number": 84, "isPrime": false, "factors": [2, 2, 3, 7] }
math_power_root
Calculate general exponents or arbitrary nth roots for numbers.
mcp toolarithmetic
| Parameter | Type | Required | Description |
|---|---|---|---|
base | number | required | Base number |
exponent | number | required | Exponent power or root degree |
mode | enum | required | power or root |
Request / Response
{ "base": 256, "exponent": 4, "mode": "root" } { "base": 256, "exponent": 4, "mode": "root", "result": 4 }
math_permutations_combinations
Calculate factorials (n!), permutations (nPr), and combinations (nCr).
mcp toolcombinatorics
| Parameter | Type | Required | Description |
|---|---|---|---|
mode | enum | required | factorial · nPr · nCr |
n | integer | required | Total items (non-negative integer) |
r | integer | optional | Selected items (required for nPr and nCr) |
Request / Response
{ "mode": "nCr", "n": 10, "r": 3 } { "mode": "nCr", "n": 10, "r": 3, "result": 120 }
Statistics & Analysis
math_statistics
Calculate summary statistics for a dataset including mean, median, mode, range, variance, and standard deviation.
mcp toolstatistics
| Parameter | Type | Required | Description |
|---|---|---|---|
numbers | array[number] | required | Non-empty array of numerical values |
Request / Response
{ "numbers": [10, 20, 20, 30, 40] } { "count": 5, "sum": 120, "mean": 24, "median": 20, "mode": [20], "minimum": 10, "maximum": 40, "range": 30, "variance": 104, "stdDev": 10.198 }
math_logarithm
Calculate logarithms with custom bases or natural logarithms (base e).
mcp toolanalysis
| Parameter | Type | Required | Description |
|---|---|---|---|
value | number | required | Target value (must be > 0) |
base | number | string | optional | Base (default: 10, or string "e" for natural log) |
Request / Response
{ "value": 100, "base": 10 } { "value": 100, "base": 10, "result": 2 }
Geometry & Trigonometry
math_geometry
Calculate measurements (area, perimeter, volume, surface area) for 2D and 3D shapes.
mcp toolgeometry
| Parameter | Type | Required | Description |
|---|---|---|---|
shape | enum | required | circle · rectangle · triangle · sphere · cylinder |
dimensions | object | required | Shape properties (e.g., radius, length, width, base, height) |
Request / Response
{ "shape": "circle", "dimensions": { "radius": 5 } } { "shape": "circle", "area": 78.5398, "circumference": 31.4159 }
math_trigonometry
Evaluate trigonometric and inverse trigonometric functions in degrees or radians.
mcp tooltrigonometry
| Parameter | Type | Required | Description |
|---|---|---|---|
func | enum | required | sin · cos · tan · asin · acos · atan |
angleValue | number | required | Angle or ratio value |
unit | enum | optional | deg (default) or rad |
Request / Response
{ "func": "sin", "angleValue": 30, "unit": "deg" } { "func": "sin", "angleValue": 30, "unit": "deg", "result": 0.5 }