Skip to main content
Glama

Regression Fit

regression_fit
Read-onlyIdempotent

Fit a regression model and get the full statistical table, like R's summary(lm) or statsmodels. Linear, polynomial (degree 2–6), exponential (y = a·e^(bx)), logarithmic, power (y = a·x^b), multiple linear (many named predictors) and binary logistic regression (IRLS, odds ratios, McFadden pseudo-R², accuracy). Returns coefficients with standard errors, t / z statistics, p-values and confidence intervals, R² and adjusted R², residual standard error, F-test, AIC / BIC, a residual summary, the fitted equation, and predictions with confidence and prediction intervals. model=best ranks the single-predictor models by adjusted R² on the original scale. Numerically stable Householder QR. Price: $0.003 USDC per successful call (x402, Solana). Same tool over HTTPS: POST https://scorptech.it.com/api/x402/v1/regression-fit

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "x": "<x>",
      "y": "<y>"
    },
    "name": "regression_fit"
  }
}

Input Schema

NameRequiredDescriptionDefault
xYesPredictor values; for model=multiple / logistic an array of rows ([[x1, x2], ...]) or a single list
yYesResponse values (0/1 for logistic); max 20,000 points
modelNolinear
namesNoPredictor names (multiple / logistic)
degreeNo
predictNox values (or rows) to predict
interceptNo
confidenceNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.5/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnly/idempotent/non-destructive, and the description still adds substantial behavior: numerical method (Householder QR), the full result payload (coefficients, SEs, t/z, p-values, CIs, R²/adjusted R², F-test, AIC/BIC, residual summary, fitted equation, predictions with intervals), the special semantics of model=best, plus pricing ($0.003 USDC per successful call via x402 on Solana) and an alternate HTTPS endpoint.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the core purpose, then output contents, then the model=best caveat, then pricing/endpoint — a sensible order. The prose is dense and sentence-long, so an agent must parse a lot, but nearly every clause carries information an agent would otherwise lack.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

There is no output schema, so the description's enumeration of returned statistics is essential and thorough, and it covers cost and transport. The gap is a few input-side details (notably 'intercept' and exact shape expectations for logistic x) that remain only in the schema strings.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With only 50% schema description coverage across 8 parameters, the description compensates well: it clarifies degree (2–6), names ('many named predictors'), predict/confidence (predictions with confidence and prediction intervals), and the meaning of model=best. Only 'intercept' is left entirely to the schema, so this is strong but not exhaustive.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb+resource ('Fit a regression model') and then enumerates every supported model family, so the agent knows exactly what capability this tool provides. It is unmistakable against siblings such as stats_describe, hypothesis_test or matrix_ops, which do not fit models.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description makes model selection concrete: polynomial is degree 2–6, multiple/logistic require many named predictors, and 'model=best ranks the single-predictor models by adjusted R² on the original scale', which tells an agent when to pick 'best'. It gives no exclusions or pointing to sibling tools for simpler descriptive stats, so it stops short of a full when-not.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources