Math.js

liveTechnology

Evaluate mathematical expressions and convert units using the mathjs.org API

2tools
0msauth
free tier50 calls/day

Tools

evaluaterequired: expression

Evaluate mathematical expressions: arithmetic, algebra, trigonometry, statistics. Returns computed result. E.g., "2+2", "sin(pi/2)", "sqrt(16)", "mean([1,2,3])". Use when you need to calculate or simp

Parameters
NameTypeDescription
expressionreqstringMathematical expression to evaluate (e.g., "2 + 3 * 4", "sqrt(16)", "sin(pi/2)", "det([1,2;3,4])")
▶Try it
convert_unitsrequired: value, from, to

Convert between units: length, weight, temperature, volume, time, etc. Returns converted value. E.g., "5 m to ft", "100 kg to lbs", "32 degF to degC". Use for unit conversions.

Parameters
NameTypeDescription
valuereqnumberNumeric value to convert (e.g., 5)
fromreqstringSource unit (e.g., "inches", "kg", "celsius", "mph")
toreqstringTarget unit (e.g., "cm", "lbs", "fahrenheit", "km/h")
▶Try it

Test with curl

The gateway speaks JSON-RPC 2.0 over HTTP POST. You can test any pack directly from the terminal.

List available tools
bash
curl -X POST https://gateway.pipeworx.io/mathjs/mcp \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'
Call a tool
bash
curl -X POST https://gateway.pipeworx.io/mathjs/mcp \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"evaluate","arguments":{"expression": "x^2 + 2x"}}}'

Use with the SDK

Install @pipeworx/sdk to call tools from any TypeScript/Node project.

TypeScript
import { Pipeworx } from '@pipeworx/sdk';
const px = new Pipeworx();
const result = await px.call("evaluate", {"expression":"example"});
ask_pipeworx
// Or ask in plain English:
const answer = await px.ask("evaluate mathematical expressions and convert units using the mathjs");