convert_units

Pack: mathjs · Endpoint: https://gateway.pipeworx.io/mathjs/mcp

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

NameTypeRequiredDescription
valuenumberyesNumeric value to convert (e.g., 5)
fromstringyesSource unit (e.g., “inches”, “kg”, “celsius”, “mph”)
tostringyesTarget unit (e.g., “cm”, “lbs”, “fahrenheit”, “km/h”)

Example call

Arguments

{
  "value": 5,
  "from": "m",
  "to": "ft"
}

curl

curl -X POST https://gateway.pipeworx.io/mathjs/mcp \
  -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"convert_units","arguments":{"value":5,"from":"m","to":"ft"}}}'

TypeScript (@pipeworx/sdk)

import { Pipeworx } from '@pipeworx/sdk';
const pipeworx = new Pipeworx();

const result = await pipeworx.call('convert_units', {
  "value": 5,
  "from": "m",
  "to": "ft"
});

More examples

{
  "value": 100,
  "from": "kg",
  "to": "lbs"
}

Response shape

Always returns: input, output, to

FieldTypeDescription
inputstringThe input value with source unit
outputstringThe converted value with target unit
tostringThe target unit
Full JSON Schema
{
  "type": "object",
  "properties": {
    "input": {
      "type": "string",
      "description": "The input value with source unit"
    },
    "output": {
      "type": "string",
      "description": "The converted value with target unit"
    },
    "to": {
      "type": "string",
      "description": "The target unit"
    }
  },
  "required": [
    "input",
    "output",
    "to"
  ]
}

Connect

Add this to your MCP client config, or use one-click install buttons:

{
  "mcpServers": {
    "mathjs": {
      "url": "https://gateway.pipeworx.io/mathjs/mcp"
    }
  }
}

See Getting Started for client-specific install steps.

Regenerated from source · build May 9, 2026