Math.js

live Math

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

2 tools
0ms auth
free tier 50 calls/day

Tools

evaluate required: expression

Evaluate a mathematical expression. Supports arithmetic, algebra, trigonometry, statistics, and more. Returns the computed result as a string.

Parameters
Name Type Description
expression req string Mathematical expression to evaluate (e.g., "2 + 3 * 4", "sqrt(16)", "sin(pi/2)", "det([1,2;3,4])")
Try it
convert_units required: value, from, to

Convert a value from one unit to another using mathjs unit syntax. Returns the converted value as a string.

Parameters
Name Type Description
value req number Numeric value to convert (e.g., 5)
from req string Source unit (e.g., "inches", "kg", "celsius", "mph")
to req string Target 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");

Related packs

Other Pipeworx packs in the same categories (Math):