Math.js
liveTechnologyEvaluate mathematical expressions and convert units using the mathjs.org API
2tools
0msauth
free tier50 calls/day
Tools
evaluaterequired: expressionEvaluate a mathematical expression. Supports arithmetic, algebra, trigonometry, statistics, and more. Returns the computed result as a string.
Parameters
NameTypeDescription
expressionreqstringMathematical expression to evaluate (e.g., "2 + 3 * 4", "sqrt(16)", "sin(pi/2)", "det([1,2;3,4])")Try it
Response
convert_unitsrequired: value, from, toConvert a value from one unit to another using mathjs unit syntax. Returns the converted value as a string.
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
Response
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");