Skip to main content
Glama

Linear Regression

calculator_linear_regression
Read-only

Fit y = a + bx with slope, intercept, R², correlation.

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

Input Schema

NameRequiredDescriptionDefault
xYesX data.
yYesY data.
predict_xNoOptional prediction X.

Output Schema

NameRequiredDescriptionDefault
slopeYes
equationNo
interceptYes
expressionYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

B3.4/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, and openWorldHint=false, so the safety profile is covered. The description adds little beyond that: it does not mention that x and y must be equal-length, what happens with a constant x (undefined slope), or how predict_x is applied, all of which matter for a fitting routine.

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?

A single front-loaded sentence with zero filler, and the model form leads. It is on the terse side for a tool with three parameters and error conditions worth flagging, but nothing is wasted.

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 values need not be restated, and all parameters are documented in the schema. What is missing is input-validity context (equal-length arrays, minimum data points, degenerate constant-x case) that an agent needs to call this correctly on real data.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already documents x, y, and predict_x, making 3 the baseline. The equation 'y = a + bx' mildly clarifies which coefficient is slope versus intercept, but the description never mentions predict_x at all, so it adds essentially nothing beyond the schema.

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?

States a specific operation (fit y = a + bx) and names the outputs (slope, intercept, R², correlation), which unambiguously identifies simple linear regression. It does not name calculator_quadratic_regression or calculator_regression as alternatives, so sibling differentiation is only implicit through the equation form.

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?

The equation form implies when to use it (linear relationship between two numeric arrays) but there is no explicit when-not guidance, no mention of minimum sample size, and no pointer to quadratic_regression for curved data. Usage is inferable but not stated.

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.