Skip to main content
Glama

simple_linear_regression

Read-onlyIdempotent

Fit a linear regression line with one predictor to estimate how y changes per unit x, including slope, intercept, R², and a significance test with confidence interval.

Instructions

Fit y = intercept + slope * x by ordinary least squares -- single predictor only. Reports the slope (change in y per unit of x), the intercept, R^2 (proportion of y's variance explained by x), and a significance test + confidence interval for the slope (H0: slope=0). Use pearson_correlation instead if you only need the strength of a linear association, not its actual units/magnitude.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
xYesthe predictor variable, one value per observation
yYesthe outcome variable, same length and pairing order as x
alphaNosignificance level for the test (and any confidence interval); default 0.05

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Addedv0.3.0

TDQS

A4.7/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, and destructiveHint=false, so the description is not burdened to cover safety. It adds value by describing the computational outputs (slope, intercept, R^2, significance test, CI) and the OLS method. It doesn't mention data handling assumptions but does not contradict annotations.

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 description is two sentences, front-loads the core functionality in the first, and provides an alternative tool in the second. Every sentence earns its place with no redundant phrasing or filler, achieving maximal clarity in minimal space.

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?

Given the simplicity of the tool and the absence of an output schema, the description fully covers what the tool returns (slope, intercept, R^2, test, CI). It also clarifies the single-predictor scope and provides an explicit alternative, making it complete for an agent to select and invoke correctly without additional context.

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 coverage is 100%, so each parameter already has descriptions. The description augments this by explaining the slope as 'change in y per unit of x,' which adds interpretive meaning beyond the schema's generic descriptions. It also ties alpha to the significance test and CI, reinforcing its role.

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?

The description clearly states the tool fits a linear regression model y = intercept + slope * x via OLS, explicitly noting it is single-predictor only. It specifies the outputs (slope, intercept, R^2, slope test and CI) and directly distinguishes itself from pearson_correlation, making its purpose unambiguous and differentiated from siblings.

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?

The description explicitly advises using pearson_correlation instead when only the strength of association is needed, and implies use when the actual slope magnitude/units are required. It also states the limitation of single predictor, giving clear context for when this tool is appropriate vs alternatives.

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

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mrnh/rigor'

If you have feedback or need assistance with the MCP directory API, please join our Discord server