Skip to main content
Glama

Stat Linear Regression

stat_linear_regression

Fit ordinary least-squares regression to model continuous outcomes from predictors, returning coefficients, confidence intervals, and model fit statistics.

Instructions

Ordinary least-squares regression with coefficients, CIs and model fit.

WHEN TO USE: continuous outcome predicted from one or more continuous or dummy-coded predictors; or when adjusting for covariates in a continuous-outcome model.

WHEN NOT TO USE:

  • Binary outcome → stat_logistic_regression.

  • Repeated measures / clustered data → a mixed-effects model; OLS standard errors will be wrong.

  • Severe multicollinearity → address it before interpreting coefficients.

The output includes R² and adjusted R². Check the assumptions listed in the output before interpreting coefficients; a significant coefficient is not evidence of a causal effect.

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": {
      "name": "<name>",
      "y": "<y>",
      "x": "<x>"
    },
    "name": "stat_linear_regression"
  }
}

Input Schema

NameRequiredDescriptionDefault
xYes
yYes
nameYes
alphaNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

No annotations are supplied, so the description carries the full burden, and it does meaningful work: it discloses the return contents (R², adjusted R², assumption checks), warns that a significant coefficient is not causal evidence, and flags the validity limit of standard errors under clustering. It stops short of stating requirements around missing data, sample size, or whether failing assumption checks abort the call, which keeps it below a 5.

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

Conciseness5/5

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

The purpose sentence leads, followed by clearly labeled WHEN TO USE and WHEN NOT TO USE blocks with arrow-marked alternatives. Every sentence adds information — the exclusions, the return summary, and the interpretation caveat all earn their place, with no restatement of the title.

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

Completeness3/5

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

An output schema exists and the description correctly defers detailed return structure to it while still summarizing the key statistics. However, with zero annotation coverage and zero parameter documentation in the schema, the description leaves the four inputs entirely unexplained, which is a real gap for a tool an agent must wire up correctly.

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

Parameters2/5

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

Schema description coverage is 0% across all four parameters, so the description must compensate and largely does not. The phrasing 'continuous outcome predicted from one or more ... predictors' loosely implies the roles of y and x, but the required `name`, the array-of-strings form of `x`, and `alpha` (presumably the CI/significance level) are never explained.

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 method (ordinary least-squares regression) plus what it returns (coefficients, CIs, model fit), which is a concrete verb+resource identification. It also distinguishes itself from stat_logistic_regression by naming it as the alternative for binary outcomes, so an agent can separate the two without opening a schema.

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

Usage Guidelines5/5

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

Gives explicit WHEN TO USE (continuous outcome, continuous or dummy-coded predictors, covariate adjustment) and WHEN NOT TO USE with three named conditions and the correct alternative for the binary case. The clustered/repeated-measures exclusion plus the warning that OLS standard errors would be wrong is exactly the kind of routing guidance that prevents misselection.

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