Skip to main content
Glama

stats.regression_linear

Read-onlyIdempotent

Run ordinary least squares linear regression on decimal matrices to compute coefficients, intercept, R², coefficient p-values, and residuals for statistical analysis.

Instructions

최소제곱(OLS) 선형회귀로 계수, 절편, R², 계수별 p값, 잔차를 구한다. X는 표본 수 x 특징 수의 Decimal 문자열 행렬, y는 표본 수 길이의 목록이며 표본 수는 특징 수 + 절편 수보다 커야 한다. add_intercept 기본 True이고 False면 절편은 "0"이다. p_values는 절편을 제외한 계수 순서이며 float64 계산 결과를 유효숫자 10자리 문자열로 돌려준다. 범주형 변수는 수치로 부호화해 넣어야 한다.

Input Schema

NameRequiredDescriptionDefault
XYes
yYes
add_interceptNo

Output Schema

NameRequiredDescriptionDefault
_metaNo서버가 붙이는 영수증(integrity), 엔진, 힌트
traceYes계산 근거(tool, formula, inputs, steps, output)
p_valuesYes
interceptYes
r_squaredYes
residualsYes
coefficientsYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.0

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already declare readOnly/idempotent/closed-world, and the description adds real behavioral detail: float64 computation, results returned as 10-significant-digit strings, intercept collapsing to "0" when add_intercept is False, and p_values ordering excluding the intercept. These are output-shape and data-format traits that annotations cannot convey.

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 computation and its outputs, then input-shape constraints, then edge-case behavior (intercept, p-value ordering, encoding). Dense but every sentence carries information; no filler or restatement of the tool name.

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

Completeness5/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 values need not be explained, yet the description still adds the ordering of p_values and the string formatting of results. Combined with the sample-size constraint and encoding requirement, an agent has everything needed to call this correctly on the first attempt.

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?

Schema description coverage is 0%, so the description must carry the load - and it largely does: X is described as an n_samples × n_features matrix of Decimal strings, y as a Decimal-string list of length n_samples, and add_intercept's effect on the intercept value is spelled out. The only gap is the precise precision/format expectation for the 'Decimal string' inputs.

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?

Opens with a specific verb+resource: OLS linear regression, and enumerates exactly what is computed (coefficients, intercept, R², per-coefficient p-values, residuals). An agent can tell this apart from the surrounding stats siblings, which are all hypothesis tests (t-tests, ANOVA, chi-square), without naming them explicitly.

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

Usage Guidelines3/5

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

Prerequisites are stated (n_samples must exceed n_features + intercept, categoricals must be pre-encoded), which tells the agent when the call is valid. However, there is no explicit when-to-use/when-not guidance and no alternative tool is named for e.g. non-linear fits.

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

Deploy Server

Other Tools