Skip to main content
Glama

linear_regression_fit

Fit least-squares linear regression models to univariate or multivariate data using closed-form methods and normal equations for exact coefficient estimates.

Instructions

Least-squares linear regression. Univariate: two closed-form methods. Multivariate: normal equations.

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": "linear_regression_fit"
  }
}

Input Schema

NameRequiredDescriptionDefault
XYes
yYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.0

TDQS

B3.1/5.0
Behavior3/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. It does add genuine behavioral context by naming the algorithms (closed-form, normal equations), which tells the caller the result is an exact solve rather than an iterative approximation, but it says nothing about numerical conditioning, intercept handling, or failure modes for singular systems.

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?

Three short, front-loaded fragments with zero filler; the mode split is stated in parallel structure. Nothing is repeated and nothing is padded, though the terseness is achieved partly by omitting detail the caller needs.

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, so return-value explanation is fairly excused, but with no annotations and a completely undescribed X parameter the caller still cannot determine the expected input shape for the two advertised modes. For a two-parameter numerical tool this is a meaningful gap, though the small surface keeps it from being severe.

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 coverage is 0%: X is typed only as an untyped array of anything and y as an array of numbers, with no descriptions. The description fails to compensate, never clarifying whether X is a 1-D list for the univariate case and a list of lists for the multivariate case, nor whether an intercept column must be supplied by the caller.

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

Purpose4/5

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

Names a specific technique, least-squares linear regression, and even enumerates the two regimes it covers (univariate closed-form, multivariate normal equations). It is clearly distinguishable from a generic regression tool, though it never says it is the fitting/estimation step and never names a contrasting sibling such as logistic_regression_calc.

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

Usage Guidelines2/5

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

No when-to-use guidance at all: nothing states that X and y are training data, nothing states the prerequisites, and nothing says when to prefer this over logistic_regression_calc or gradient_descent_steps. The word 'univariate' vs 'multivariate' hints at a selection criterion but never states how the caller signals which mode applies.

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