Skip to main content
Glama

Calculate

calculate
Read-onlyIdempotent

Evaluate math expressions, simplify algebraic expressions, or compute symbolic derivatives. One expression per call. Supports arithmetic, trigonometry, statistics, matrices, complex numbers, units, and combinatorics.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
scopeNoVariable assignments for evaluate; simplify and derivative ignore them. Example: { "x": 5, "y": 3 } makes "x + y" evaluate to 8.
variableNoVariable to differentiate with respect to. Required when operation is "derivative". Empty string is treated as omitted. Example: "x".
operationNoOperation to perform. "evaluate" computes a numeric result (default). "simplify" reduces an algebraic expression symbolically (e.g., "2x + 3x" -> "5 * x"). Supports algebraic and trigonometric identities. When the simplifier cannot reduce the expression further (e.g. rational expressions requiring polynomial factoring), the result is returned unchanged and unchanged: true is set in the output. "derivative" computes the symbolic derivative (requires the variable parameter).evaluate
precisionNoSignificant digits (1–16) for numeric results. Omit for full precision. Empty string is treated as omitted. Fraction results always print exactly, and symbolic operations (simplify, derivative) ignore it.
expressionYesOne mathematical expression per call — neither `;` nor newlines separate statements. Inside matrices, `;` separates rows (e.g. `[1, 2; 3, 4]`). Supports arithmetic (+, -, *, /, ^, %), functions across arithmetic/trig (sin, cos, sqrt, log, abs, round), statistics (mean, median, std, variance — std and variance return the sample (n − 1) form by default; pass "uncorrected" for the population form, e.g. `std([2, 4, 6], "uncorrected")`), combinatorics (factorial, permutations, combinations), and matrix (det, inv, transpose), plus constants (pi, e, phi, i), units (5 kg to lbs), and variables (when scope is provided). Standard notation `ln` and `arc*` (e.g. `arcsin`, `arctan`) is accepted alongside the math.js names `log` and `asin`/`atan`; common synonyms such as `stdev`, `permute`, `nCr`, and `length`/`len` resolve to their math.js names (`std`, `permutations`, `combinations`, `count`).
numericTypeNoNumeric type for evaluate. "number" (default): 64-bit IEEE 754 float — fastest, about 16 significant digits; a value past about 1.8e308 (171!, 2^1024, exp(1000)) overflows and fails with undefined_result. "BigNumber": decimal with 64 significant digits and a much wider exponent range, slower than "number" — retry an overflow with it; results are 64-digit approximations (10000!/9999! returns 9999.99…96, which precision: 16 rounds to 10000). Division by zero, 0/0, and log(0) are undefined in every numeric type, so another numeric type does not fix them. "Fraction": exact rational arithmetic (0.1 + 0.2 returns 3/10); fails with fraction_unsupported when the result has no exact rational value (sqrt(2), sin(1), log(3)), the expression calls a function Fraction mode cannot compute (sqrt(4), 5!, combinations(5, 2)), or it uses a value Fraction mode holds only as a rounded float (pi, e, 2^(1/2), a complex number with a non-integer part, number(x), random()) — use "number" or "BigNumber" for those. A unit conversion with an irrational factor (30 deg to rad) returns a close rational approximation, not an exact value. Ignored for symbolic operations (simplify, derivative).number

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
errorNoPresent when the call failed. Absent on success.
resultNoThe computed result as a string.
operationNoThe operation that was applied.
scopeVarsNoKeys from the scope that were active during evaluation. Omitted when no scope was provided and for symbolic operations, which ignore scope. Values are omitted to keep output compact.
unchangedNoPresent only for simplify operations. true means the simplifier returned the expression unchanged — it could not reduce it further (e.g. rational expressions requiring polynomial factoring are beyond math.js's built-in simplifier). false means simplification made progress. Omitted for evaluate and derivative.
expressionNoThe original expression as received.
resultTypeNoType of result as reported by math.js. Common values: number, BigNumber, Fraction, Complex, DenseMatrix, SparseMatrix, Array, Unit, string, boolean. Symbolic operations return "string".
precisionUsedNoThe precision value supplied for evaluate. Fraction results print exactly regardless. Omitted when no precision was supplied or the operation is symbolic.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed9 schema fields changed
    • changedInput schema / properties / expression / description
      Previous value: -"One mathematical expression per call — neither `;` nor newlines separate statements. Inside matrices, `;` separates rows (e.g. `[1, 2; 3, 4]`). Supports arithmetic (+, -, *, /, ^, %), functions across arithmetic/trig (sin, cos, sqrt, log, abs, round), statistics (mean, median, std, variance), combinatorics (factorial, permutations, combinations), and matrix (det, inv, transpose), plus constants (pi, e, phi, i), units (5 kg to lbs), and variables (when scope is provided). Standard notation `ln` and `arc*` (e.g. `arcsin`, `arctan`) is accepted alongside the math.js names `log` and `asin`/`atan`; common synonyms such as `stdev`, `permute`, `nCr`, and `length`/`len` resolve to their math.js names (`std`, `permutations`, `combinations`, `count`)."New value: +"One mathematical expression per call — neither `;` nor newlines separate statements. Inside matrices, `;` separates rows (e.g. `[1, 2; 3, 4]`). Supports arithmetic (+, -, *, /, ^, %), functions across arithmetic/trig (sin, cos, sqrt, log, abs, round), statistics (mean, median, std, variance — std and variance return the sample (n − 1) form by default; pass \"uncorrected\" for the population form, e.g. `std([2, 4, 6], \"uncorrected\")`), combinatorics (factorial, permutations, combinations), and matrix (det, inv, transpose), plus constants (pi, e, phi, i), units (5 kg to lbs), and variables (when scope is provided). Standard notation `ln` and `arc*` (e.g. `arcsin`, `arctan`) is accepted alongside the math.js names `log` and `asin`/`atan`; common synonyms such as `stdev`, `permute`, `nCr`, and `length`/`len` resolve to their math.js names (`std`, `permutations`, `combinations`, `count`)."
    • changedInput schema / properties / numericType / description
      Previous value: -"Numeric type for evaluate. \"number\" (default): 64-bit IEEE 754 float — fastest, standard precision. \"BigNumber\": arbitrary-precision decimal — use when intermediate values overflow 64-bit float (e.g. large factorial ratios like 10000!/9999!); slower than \"number\". \"Fraction\": exact rational arithmetic — eliminates floating-point rounding (e.g. 0.1 + 0.2 = 0.3 exactly); limited to expressions with exactly-rational results — an irrational or transcendental result (sqrt, sin, log, …) fails with fraction_unsupported, so use \"number\" or \"BigNumber\" for those. Ignored for symbolic operations (simplify, derivative). When \"number\" evaluation produces a non-finite result (undefined_result error), retry with \"BigNumber\"."New value: +"Numeric type for evaluate. \"number\" (default): 64-bit IEEE 754 float — fastest, about 16 significant digits; a value past about 1.8e308 (171!, 2^1024, exp(1000)) overflows and fails with undefined_result. \"BigNumber\": decimal with 64 significant digits and a much wider exponent range, slower than \"number\" — retry an overflow with it; results are 64-digit approximations (10000!/9999! returns 9999.99…96, which precision: 16 rounds to 10000). Division by zero, 0/0, and log(0) are undefined in every numeric type, so another numeric type does not fix them. \"Fraction\": exact rational arithmetic (0.1 + 0.2 returns 3/10); fails with fraction_unsupported when the result has no exact rational value (sqrt(2), sin(1), log(3)), the expression calls a function Fraction mode cannot compute (sqrt(4), 5!, combinations(5, 2)), or it uses a value Fraction mode holds only as a rounded float (pi, e, 2^(1/2), a complex number with a non-integer part, number(x), random()) — use \"number\" or \"BigNumber\" for those. A unit conversion with an irrational factor (30 deg to rad) returns a close rational approximation, not an exact value. Ignored for symbolic operations (simplify, derivative)."
    • changedInput schema / properties / precision / description
      Previous value: -"Significant digits (1–16) for numeric results. Omit for full precision. Empty string is treated as omitted. Ignored for symbolic operations (simplify, derivative)."New value: +"Significant digits (1–16) for numeric results. Omit for full precision. Empty string is treated as omitted. Fraction results always print exactly, and symbolic operations (simplify, derivative) ignore it."
    • changedInput schema / properties / scope / description
      Previous value: -"Variable assignments for the expression. Example: { \"x\": 5, \"y\": 3 } makes \"x + y\" evaluate to 8."New value: +"Variable assignments for evaluate; simplify and derivative ignore them. Example: { \"x\": 5, \"y\": 3 } makes \"x + y\" evaluate to 8."
    • changedOutput schema / properties / error / properties / data / properties / reason / description
      Previous value: -"Machine-readable failure mode. Declared by this tool: `empty_expression`: Expression is empty or whitespace-only. `expression_too_long`: Expression exceeds the configured max length (CALC_MAX_EXPRESSION_LENGTH). `multiple_expressions`: Expression contains a separator (`;` or newline) outside matrix brackets. `reserved_scope_key`: Scope contains a reserved JS property name (`__proto__`, `constructor`, etc.). `disallowed_result_type`: Result is a function, parser, or multi-expression ResultSet, or the expression converts a function to a string (e.g. `cos.toString()`) — security guard. `result_too_large`: Stringified result exceeds the configured max size (CALC_MAX_RESULT_LENGTH). `undefined_result`: Expression evaluated to Infinity, -Infinity, or NaN (e.g., division by zero). `fraction_unsupported`: numericType is \"Fraction\" but the expression has no exact rational value (irrational or transcendental result, e.g. sqrt, sin, log). `parse_failed`: mathjs could not parse the expression. `derivative_missing_variable`: `operation` is `derivative` but `variable` was not provided. `evaluation_timeout`: Expression evaluation exceeded the configured timeout (CALC_EVALUATION_TIMEOUT_MS). Other values are possible when a failure originates below the handler."New value: +"Machine-readable failure mode. Declared by this tool: `empty_expression`: Expression is empty or whitespace-only. `expression_too_long`: Expression exceeds the configured max length (CALC_MAX_EXPRESSION_LENGTH). `multiple_expressions`: Expression holds more than one statement — a `;` or newline at the top level, outside brackets, parentheses, and string literals. `reserved_scope_key`: Scope contains a reserved JS property name (`__proto__`, `constructor`, etc.). `disallowed_result_type`: The result is a function (e.g. a bare `sin`, or `f(x) = x^2`) or a help() object, or the expression converts a function to a string (e.g. `cos.toString()`) — security guard. `result_too_large`: The result exceeds the configured max size (CALC_MAX_RESULT_LENGTH), or the expression would build a matrix or string over the per-call limit (1,000,000 elements or characters), or more than 20,000,000 in total across one evaluation. `undefined_result`: The result is Infinity, -Infinity, or NaN anywhere in it (including matrix elements, unit magnitudes, and object values): an undefined operation such as 1/0, 0/0, or log(0), or a value that overflowed its numeric range (e.g. 171! or 2^1024 under numericType \"number\"). `fraction_unsupported`: numericType is \"Fraction\" and the result has no exact rational value (e.g. sqrt(2), sin(1), log(3)), the expression calls a function Fraction mode cannot compute, even for a rational result (e.g. sqrt(4), 5!, combinations(5, 2)), or it uses a value Fraction mode holds only as a rounded 64-bit float (e.g. pi, e, 2^(1/2), a complex number with a non-integer part, number(x), random()). `parse_failed`: mathjs could not parse the expression, or it names an undefined symbol, function, or unit, or calls a function disabled for security. `operation_as_function`: The expression calls `evaluate`, `simplify`, or `derivative` — those are operations, selected with the `operation` parameter. `type_mismatch`: An operand has the wrong type or unit for the operation — a bare number added to a unit, mismatched units, a unit in an exponent, a non-numeric string in arithmetic, or a function used as a value (`5 min`, where `min` is the minimum function; that case carries its own recovery hint). `evaluation_failed`: The expression parsed but could not be computed — wrong argument count, a value outside the function domain, a singular matrix, mismatched matrix dimensions, or an index out of range — or simplify/derivative cannot process part of it (e.g. a function with no derivative rule). `derivative_missing_variable`: `operation` is `derivative` but `variable` was not provided. `evaluation_timeout`: Expression evaluation exceeded the configured timeout (CALC_EVALUATION_TIMEOUT_MS). Other values are possible when a failure originates below the handler."
    • changedOutput schema / properties / error / properties / data / properties / reason / examples
      Previous value: -[
      -  "empty_expression",
      -  "expression_too_long",
      -  "multiple_expressions",
      -  "reserved_scope_key",
      -  "disallowed_result_type",
      -  "result_too_large",
      -  "undefined_result",
      -  "fraction_unsupported",
      -  "parse_failed",
      -  "derivative_missing_variable",
      -  "evaluation_timeout"
      -]New value: +[
      +  "empty_expression",
      +  "expression_too_long",
      +  "multiple_expressions",
      +  "reserved_scope_key",
      +  "disallowed_result_type",
      +  "result_too_large",
      +  "undefined_result",
      +  "fraction_unsupported",
      +  "parse_failed",
      +  "operation_as_function",
      +  "type_mismatch",
      +  "evaluation_failed",
      +  "derivative_missing_variable",
      +  "evaluation_timeout"
      +]
    • changedOutput schema / properties / precisionUsed / description
      Previous value: -"Significant-digit precision applied to the result. Omitted when full precision was used or the operation is symbolic."New value: +"The precision value supplied for evaluate. Fraction results print exactly regardless. Omitted when no precision was supplied or the operation is symbolic."
    • changedOutput schema / properties / resultType / description
      Previous value: -"Type of result as reported by math.js: number, BigNumber, Complex, DenseMatrix, Unit, string, boolean. Symbolic operations return \"string\"."New value: +"Type of result as reported by math.js. Common values: number, BigNumber, Fraction, Complex, DenseMatrix, SparseMatrix, Array, Unit, string, boolean. Symbolic operations return \"string\"."
    • changedOutput schema / properties / scopeVars / description
      Previous value: -"Keys from the scope that were active during evaluation. Omitted when no scope was provided. Values are omitted to keep output compact."New value: +"Keys from the scope that were active during evaluation. Omitted when no scope was provided and for symbolic operations, which ignore scope. Values are omitted to keep output compact."
  2. Changed6 schema fields changed
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • addedInput schema / additionalProperties
      Added value: +false
    • changedOutput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • addedOutput schema / anyOf
      Added value: +[
      +  {
      +    "not": {
      +      "required": [
      +        "error"
      +      ]
      +    },
      +    "required": [
      +      "result",
      +      "resultType",
      +      "expression",
      +      "operation"
      +    ]
      +  },
      +  {
      +    "required": [
      +      "error"
      +    ]
      +  }
      +]
    • addedOutput schema / properties / error
      Added value: +{
      +  "additionalProperties": {},
      +  "description": "Present when the call failed. Absent on success.",
      +  "properties": {
      +    "code": {
      +      "description": "JSON-RPC error code for this failure.",
      +      "maximum": 9007199254740991,
      +      "minimum": -9007199254740991,
      +      "type": "integer"
      +    },
      +    "data": {
      +      "additionalProperties": {},
      +      "properties": {
      +        "reason": {
      +          "description": "Machine-readable failure mode. Declared by this tool: `empty_expression`: Expression is empty or whitespace-only. `expression_too_long`: Expression exceeds the configured max length (CALC_MAX_EXPRESSION_LENGTH). `multiple_expressions`: Expression contains a separator (`;` or newline) outside matrix brackets. `reserved_scope_key`: Scope contains a reserved JS property name (`__proto__`, `constructor`, etc.). `disallowed_result_type`: Result is a function, parser, or multi-expression ResultSet, or the expression converts a function to a string (e.g. `cos.toString()`) — security guard. `result_too_large`: Stringified result exceeds the configured max size (CALC_MAX_RESULT_LENGTH). `undefined_result`: Expression evaluated to Infinity, -Infinity, or NaN (e.g., division by zero). `fraction_unsupported`: numericType is \"Fraction\" but the expression has no exact rational value (irrational or transcendental result, e.g. sqrt, sin, log). `parse_failed`: mathjs could not parse the expression. `derivative_missing_variable`: `operation` is `derivative` but `variable` was not provided. `evaluation_timeout`: Expression evaluation exceeded the configured timeout (CALC_EVALUATION_TIMEOUT_MS). Other values are possible when a failure originates below the handler.",
      +          "examples": [
      +            "empty_expression",
      +            "expression_too_long",
      +            "multiple_expressions",
      +            "reserved_scope_key",
      +            "disallowed_result_type",
      +            "result_too_large",
      +            "undefined_result",
      +            "fraction_unsupported",
      +            "parse_failed",
      +            "derivative_missing_variable",
      +            "evaluation_timeout"
      +          ],
      +          "type": "string"
      +        },
      +        "recovery": {
      +          "additionalProperties": {},
      +          "description": "Actionable next step for the caller.",
      +          "properties": {
      +            "hint": {
      +              "type": "string"
      +            }
      +          },
      +          "required": [
      +            "hint"
      +          ],
      +          "type": "object"
      +        },
      +        "retryable": {
      +          "description": "Whether retrying may succeed.",
      +          "type": "boolean"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "message": {
      +      "description": "Human-readable description of what went wrong.",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "code",
      +    "message"
      +  ],
      +  "type": "object"
      +}
    • removedOutput schema / required
      Removed value: -[
      -  "result",
      -  "resultType",
      -  "expression",
      -  "operation"
      -]
  3. Changed2 schema fields changed
    • changedInput schema / properties / expression / description
      Previous value: -"One mathematical expression per call — neither `;` nor newlines separate statements. Inside matrices, `;` separates rows (e.g. `[1, 2; 3, 4]`). Supports arithmetic (+, -, *, /, ^, %), functions across arithmetic/trig (sin, cos, sqrt, log, abs, round), statistics (mean, median, std, variance), combinatorics (factorial, permutations, combinations), and matrix (det, inv, transpose), plus constants (pi, e, phi, i), units (5 kg to lbs), and variables (when scope is provided). Standard notation `ln` and `arc*` (e.g. `arcsin`, `arctan`) is accepted alongside the math.js names `log` and `asin`/`atan`; common synonyms such as `stdev`, `permute`, and `nCr` resolve to their math.js names (`std`, `permutations`, `combinations`)."New value: +"One mathematical expression per call — neither `;` nor newlines separate statements. Inside matrices, `;` separates rows (e.g. `[1, 2; 3, 4]`). Supports arithmetic (+, -, *, /, ^, %), functions across arithmetic/trig (sin, cos, sqrt, log, abs, round), statistics (mean, median, std, variance), combinatorics (factorial, permutations, combinations), and matrix (det, inv, transpose), plus constants (pi, e, phi, i), units (5 kg to lbs), and variables (when scope is provided). Standard notation `ln` and `arc*` (e.g. `arcsin`, `arctan`) is accepted alongside the math.js names `log` and `asin`/`atan`; common synonyms such as `stdev`, `permute`, `nCr`, and `length`/`len` resolve to their math.js names (`std`, `permutations`, `combinations`, `count`)."
    • changedInput schema / properties / numericType / description
      Previous value: -"Numeric type for evaluate. \"number\" (default): 64-bit IEEE 754 float — fastest, standard precision. \"BigNumber\": arbitrary-precision decimal — use when intermediate values overflow 64-bit float (e.g. large factorial ratios like 10000!/9999!); slower than \"number\". \"Fraction\": exact rational arithmetic — eliminates floating-point rounding (e.g. 0.1 + 0.2 = 0.3 exactly); limited to expressions without transcendental functions. Ignored for symbolic operations (simplify, derivative). When \"number\" evaluation produces a non-finite result (undefined_result error), retry with \"BigNumber\"."New value: +"Numeric type for evaluate. \"number\" (default): 64-bit IEEE 754 float — fastest, standard precision. \"BigNumber\": arbitrary-precision decimal — use when intermediate values overflow 64-bit float (e.g. large factorial ratios like 10000!/9999!); slower than \"number\". \"Fraction\": exact rational arithmetic — eliminates floating-point rounding (e.g. 0.1 + 0.2 = 0.3 exactly); limited to expressions with exactly-rational results — an irrational or transcendental result (sqrt, sin, log, …) fails with fraction_unsupported, so use \"number\" or \"BigNumber\" for those. Ignored for symbolic operations (simplify, derivative). When \"number\" evaluation produces a non-finite result (undefined_result error), retry with \"BigNumber\"."
  4. Changed1 schema field changed
    • changedInput schema / properties / expression / description
      Previous value: -"One mathematical expression per call — neither `;` nor newlines separate statements. Inside matrices, `;` separates rows (e.g. `[1, 2; 3, 4]`). Supports arithmetic (+, -, *, /, ^, %), functions (sin, cos, sqrt, log, abs, round, etc.), constants (pi, e, phi, i), matrices, units (5 kg to lbs), and variables (when scope is provided). Standard notation `ln` and `arc*` (e.g. `arcsin`, `arctan`) is accepted alongside the math.js names `log` and `asin`/`atan`."New value: +"One mathematical expression per call — neither `;` nor newlines separate statements. Inside matrices, `;` separates rows (e.g. `[1, 2; 3, 4]`). Supports arithmetic (+, -, *, /, ^, %), functions across arithmetic/trig (sin, cos, sqrt, log, abs, round), statistics (mean, median, std, variance), combinatorics (factorial, permutations, combinations), and matrix (det, inv, transpose), plus constants (pi, e, phi, i), units (5 kg to lbs), and variables (when scope is provided). Standard notation `ln` and `arc*` (e.g. `arcsin`, `arctan`) is accepted alongside the math.js names `log` and `asin`/`atan`; common synonyms such as `stdev`, `permute`, and `nCr` resolve to their math.js names (`std`, `permutations`, `combinations`)."
  5. Changed3 schema fields changed
    • addedInput schema / properties / numericType
      Added value: +{
      +  "default": "number",
      +  "description": "Numeric type for evaluate. \"number\" (default): 64-bit IEEE 754 float — fastest, standard precision. \"BigNumber\": arbitrary-precision decimal — use when intermediate values overflow 64-bit float (e.g. large factorial ratios like 10000!/9999!); slower than \"number\". \"Fraction\": exact rational arithmetic — eliminates floating-point rounding (e.g. 0.1 + 0.2 = 0.3 exactly); limited to expressions without transcendental functions. Ignored for symbolic operations (simplify, derivative). When \"number\" evaluation produces a non-finite result (undefined_result error), retry with \"BigNumber\".",
      +  "enum": [
      +    "number",
      +    "BigNumber",
      +    "Fraction"
      +  ],
      +  "type": "string"
      +}
    • changedInput schema / properties / operation / description
      Previous value: -"Operation to perform. \"evaluate\" computes a numeric result (default). \"simplify\" reduces an algebraic expression symbolically (e.g., \"2x + 3x\" -> \"5 * x\"). Supports algebraic and trigonometric identities. \"derivative\" computes the symbolic derivative (requires the variable parameter)."New value: +"Operation to perform. \"evaluate\" computes a numeric result (default). \"simplify\" reduces an algebraic expression symbolically (e.g., \"2x + 3x\" -> \"5 * x\"). Supports algebraic and trigonometric identities. When the simplifier cannot reduce the expression further (e.g. rational expressions requiring polynomial factoring), the result is returned unchanged and unchanged: true is set in the output. \"derivative\" computes the symbolic derivative (requires the variable parameter)."
    • addedOutput schema / properties / unchanged
      Added value: +{
      +  "description": "Present only for simplify operations. true means the simplifier returned the expression unchanged — it could not reduce it further (e.g. rational expressions requiring polynomial factoring are beyond math.js's built-in simplifier). false means simplification made progress. Omitted for evaluate and derivative.",
      +  "type": "boolean"
      +}
  6. Changed8 schema fields changed
    • removedOutput schema / properties / precisionUsed / anyOf
      Removed value: -[
      -  {
      -    "type": "number"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • changedOutput schema / properties / precisionUsed / description
      Previous value: -"Significant-digit precision that was applied, or null when full precision was used or the operation is symbolic."New value: +"Significant-digit precision applied to the result. Omitted when full precision was used or the operation is symbolic."
    • addedOutput schema / properties / precisionUsed / type
      Added value: +"number"
    • removedOutput schema / properties / scopeVars / anyOf
      Removed value: -[
      -  {
      -    "items": {
      -      "type": "string"
      -    },
      -    "type": "array"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • changedOutput schema / properties / scopeVars / description
      Previous value: -"Keys from the scope that were active during evaluation, or null when no scope was provided. Values are omitted to keep output compact."New value: +"Keys from the scope that were active during evaluation. Omitted when no scope was provided. Values are omitted to keep output compact."
    • addedOutput schema / properties / scopeVars / items
      Added value: +{
      +  "type": "string"
      +}
    • addedOutput schema / properties / scopeVars / type
      Added value: +"array"
    • changedOutput schema / required
      Previous value: -[
      -  "result",
      -  "resultType",
      -  "expression",
      -  "operation",
      -  "scopeVars",
      -  "precisionUsed"
      -]New value: +[
      +  "result",
      +  "resultType",
      +  "expression",
      +  "operation"
      +]
  7. Changed5 schema fields changed
    • changedInput schema / properties / expression / description
      Previous value: -"One mathematical expression per call — neither `;` nor newlines separate statements. Inside matrices, `;` separates rows (e.g. `[1, 2; 3, 4]`). Supports arithmetic (+, -, *, /, ^, %), functions (sin, cos, sqrt, log, abs, round, etc.), constants (pi, e, phi, i), matrices, units (5 kg to lbs), and variables (when scope is provided)."New value: +"One mathematical expression per call — neither `;` nor newlines separate statements. Inside matrices, `;` separates rows (e.g. `[1, 2; 3, 4]`). Supports arithmetic (+, -, *, /, ^, %), functions (sin, cos, sqrt, log, abs, round, etc.), constants (pi, e, phi, i), matrices, units (5 kg to lbs), and variables (when scope is provided). Standard notation `ln` and `arc*` (e.g. `arcsin`, `arctan`) is accepted alongside the math.js names `log` and `asin`/`atan`."
    • addedOutput schema / properties / operation
      Added value: +{
      +  "description": "The operation that was applied.",
      +  "enum": [
      +    "evaluate",
      +    "simplify",
      +    "derivative"
      +  ],
      +  "type": "string"
      +}
    • addedOutput schema / properties / precisionUsed
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "number"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "description": "Significant-digit precision that was applied, or null when full precision was used or the operation is symbolic."
      +}
    • addedOutput schema / properties / scopeVars
      Added value: +{
      +  "anyOf": [
      +    {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "description": "Keys from the scope that were active during evaluation, or null when no scope was provided. Values are omitted to keep output compact."
      +}
    • changedOutput schema / required
      Previous value: -[
      -  "result",
      -  "resultType",
      -  "expression"
      -]New value: +[
      +  "result",
      +  "resultType",
      +  "expression",
      +  "operation",
      +  "scopeVars",
      +  "precisionUsed"
      +]
  8. Changed5 schema fields changed
    • changedInput schema / properties / expression / description
      Previous value: -"Mathematical expression to evaluate. Supports standard notation: arithmetic (+, -, *, /, ^, %), functions (sin, cos, sqrt, log, abs, round, etc.), constants (pi, e, phi, i), matrices ([1, 2; 3, 4]), units (5 kg to lbs), and variables (when scope is provided)."New value: +"One mathematical expression per call — neither `;` nor newlines separate statements. Inside matrices, `;` separates rows (e.g. `[1, 2; 3, 4]`). Supports arithmetic (+, -, *, /, ^, %), functions (sin, cos, sqrt, log, abs, round, etc.), constants (pi, e, phi, i), matrices, units (5 kg to lbs), and variables (when scope is provided)."
    • changedInput schema / properties / precision / anyOf
      Previous value: -[
      -  {
      -    "const": "",
      -    "description": "Empty string — treated as omitted (for form-based clients).",
      -    "type": "string"
      -  },
      -  {
      -    "description": "Significant digits (integer, 1–16).",
      -    "maximum": 16,
      -    "minimum": 1,
      -    "type": "integer"
      -  }
      -]New value: +[
      +  {
      +    "const": "",
      +    "description": "Empty string — treated as omitted.",
      +    "type": "string"
      +  },
      +  {
      +    "description": "Significant digits (integer, 1–16).",
      +    "maximum": 16,
      +    "minimum": 1,
      +    "type": "integer"
      +  }
      +]
    • changedInput schema / properties / precision / description
      Previous value: -"Significant digits (1–16) for numeric results. Omit for full precision. Blank values from form-based clients are treated as omitted. Ignored for symbolic operations (simplify, derivative)."New value: +"Significant digits (1–16) for numeric results. Omit for full precision. Empty string is treated as omitted. Ignored for symbolic operations (simplify, derivative)."
    • changedInput schema / properties / variable / anyOf
      Previous value: -[
      -  {
      -    "const": "",
      -    "description": "Empty string — treated as omitted (for form-based clients).",
      -    "type": "string"
      -  },
      -  {
      -    "description": "Variable identifier (alphanumeric and underscores, max 50 chars).",
      -    "maxLength": 50,
      -    "pattern": "^[a-zA-Z_][a-zA-Z0-9_]*$",
      -    "type": "string"
      -  }
      -]New value: +[
      +  {
      +    "const": "",
      +    "description": "Empty string — treated as omitted.",
      +    "type": "string"
      +  },
      +  {
      +    "description": "Variable identifier (alphanumeric and underscores, max 50 chars).",
      +    "maxLength": 50,
      +    "pattern": "^[a-zA-Z_][a-zA-Z0-9_]*$",
      +    "type": "string"
      +  }
      +]
    • changedInput schema / properties / variable / description
      Previous value: -"Variable to differentiate with respect to. Required when operation is \"derivative\". Blank values from form-based clients are treated as omitted. Example: \"x\"."New value: +"Variable to differentiate with respect to. Required when operation is \"derivative\". Empty string is treated as omitted. Example: \"x\"."
  9. Changed2 schema fields changed
    • changedInput schema / properties / precision / anyOf
      Previous value: -[
      -  {
      -    "const": "",
      -    "type": "string"
      -  },
      -  {
      -    "maximum": 16,
      -    "minimum": 1,
      -    "type": "integer"
      -  }
      -]New value: +[
      +  {
      +    "const": "",
      +    "description": "Empty string — treated as omitted (for form-based clients).",
      +    "type": "string"
      +  },
      +  {
      +    "description": "Significant digits (integer, 1–16).",
      +    "maximum": 16,
      +    "minimum": 1,
      +    "type": "integer"
      +  }
      +]
    • changedInput schema / properties / variable / anyOf
      Previous value: -[
      -  {
      -    "const": "",
      -    "type": "string"
      -  },
      -  {
      -    "maxLength": 50,
      -    "pattern": "^[a-zA-Z_][a-zA-Z0-9_]*$",
      -    "type": "string"
      -  }
      -]New value: +[
      +  {
      +    "const": "",
      +    "description": "Empty string — treated as omitted (for form-based clients).",
      +    "type": "string"
      +  },
      +  {
      +    "description": "Variable identifier (alphanumeric and underscores, max 50 chars).",
      +    "maxLength": 50,
      +    "pattern": "^[a-zA-Z_][a-zA-Z0-9_]*$",
      +    "type": "string"
      +  }
      +]
  10. Changed11 schema fields changed
    • changedInput schema / properties / operation / description
      Previous value: -"Operation to perform. \"evaluate\" computes a numeric result (default). \"simplify\" reduces an algebraic expression symbolically (e.g., \"2x + 3x\" -> \"5 * x\"). Supports algebraic and trigonometric identities. \"derivative\" computes the symbolic derivative (requires variable parameter)."New value: +"Operation to perform. \"evaluate\" computes a numeric result (default). \"simplify\" reduces an algebraic expression symbolically (e.g., \"2x + 3x\" -> \"5 * x\"). Supports algebraic and trigonometric identities. \"derivative\" computes the symbolic derivative (requires the variable parameter)."
    • addedInput schema / properties / precision / anyOf
      Added value: +[
      +  {
      +    "const": "",
      +    "type": "string"
      +  },
      +  {
      +    "maximum": 16,
      +    "minimum": 1,
      +    "type": "integer"
      +  }
      +]
    • changedInput schema / properties / precision / description
      Previous value: -"Significant digits (1–16) for numeric results. Omit for full precision. Ignored for symbolic operations (simplify, derivative)."New value: +"Significant digits (1–16) for numeric results. Omit for full precision. Blank values from form-based clients are treated as omitted. Ignored for symbolic operations (simplify, derivative)."
    • removedInput schema / properties / precision / maximum
      Removed value: -16
    • removedInput schema / properties / precision / minimum
      Removed value: -1
    • removedInput schema / properties / precision / type
      Removed value: -"integer"
    • addedInput schema / properties / variable / anyOf
      Added value: +[
      +  {
      +    "const": "",
      +    "type": "string"
      +  },
      +  {
      +    "maxLength": 50,
      +    "pattern": "^[a-zA-Z_][a-zA-Z0-9_]*$",
      +    "type": "string"
      +  }
      +]
    • changedInput schema / properties / variable / description
      Previous value: -"Variable to differentiate with respect to. Required when operation is \"derivative\". Example: \"x\"."New value: +"Variable to differentiate with respect to. Required when operation is \"derivative\". Blank values from form-based clients are treated as omitted. Example: \"x\"."
    • removedInput schema / properties / variable / maxLength
      Removed value: -50
    • removedInput schema / properties / variable / pattern
      Removed value: -"^[a-zA-Z_][a-zA-Z0-9_]*$"
    • removedInput schema / properties / variable / type
      Removed value: -"string"
  11. First observed

TDQS

A4.1/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=true and idempotentHint=true, so the safety profile is established. The description adds mild behavioral context with the 'One expression per call' rule and the supported-domain list. It does not disclose error conditions, precision limits, or numeric-type edge cases, but those are thoroughly elaborated in the schema descriptions, so the description only needs to complement, not replicate, that information.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is three short sentences that front-load the core purpose, state a critical usage rule, and list capabilities. Each sentence adds distinct information, and there is no redundancy or fluff.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The schema is exceptionally rich—covering operation semantics, numericType edge cases, variable constraints, precision behavior, and scope examples—and an output schema exists. With annotations declaring readOnly and idempotent behavior, the description's high-level summary is all that is needed to orient the agent; no invocation-critical detail is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with detailed descriptions and examples for expression, operation, variable, precision, numericType, and scope. The tool description itself does not discuss parameters, but with full schema coverage the baseline of 3 applies. The description adds no parameter-level meaning, but none is needed because the schema carries the burden.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with specific verbs and resources: 'Evaluate math expressions, simplify algebraic expressions, or compute symbolic derivatives.' This clearly names the tool's function and scope. Although there are no sibling tools to differentiate from, the capability list (arithmetic, trigonometry, statistics, matrices, complex numbers, units, combinatorics) leaves no ambiguity about what the tool does.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context by enumerating three operations and adding the constraint 'One expression per call,' which tells the agent the input cardinality. Since there are no sibling tools, exclusions and alternatives are unnecessary. The description does not explicitly state when to prefer one operation over another, but the schema's operation field covers that.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.