Home / Servers / Calculators / linear_regression

Linear regression

An MCP tool from the Calculators server, hosted on mcp.hjlabs.in.

Fit a straight line y = m·x + b to paired data: slope, intercept, r, r² and predictions for x values you give. Use for trends and simple forecasts.

Name on the gateway: math__linear_regression · read-only.

Parameters

NameTypeDescription
x requiredarrayThe x values.
y requiredarrayThe y values, same length as x.
predictarrayx values to predict y for. Optional.

How to call it

Through the Smart Gateway, any client can run it by name with call_tool, or let the gateway find it with search_tools:

call_tool arguments
{
  "name": "math__linear_regression",
  "arguments": {
    "x": [],
    "y": []
  }
}

Or connect the Calculators server directly, which lists 28 tools including this one:

Run in your terminal
claude mcp add --transport http hj-math https://mcp.hjlabs.in/mcp/math \
  --header "Authorization: Bearer YOUR_API_KEY"

Try asking

Use the linear regression tool with x set to ….

More from Calculators