Skip to main content
Glama
Chetto983

Mathematical Calculator MCP Server

by Chetto983

linear_regression

Computes the slope and intercept of a linear regression line from a set of (x, y) points.

Instructions

Performs linear regression on a set of points and returns the slope and intercept.

Args: data: A list of tuples, where each tuple contains (x, y) coordinates.

Returns: On success: {"slope": , "intercept": } On error: {"error": }

Examples: >>> linear_regression([(1, 2), (2, 3), (3, 5)]) {'slope': 1.5, 'intercept': 0.3333333333333335}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.1

TDQS

A3.7/5.0
Behavior3/5

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

With no annotations, the description carries the full disclosure burden. It usefully documents the return contract (a slope/intercept object on success, an error object on failure) and gives a concrete worked example, which is genuine added value. However, it is silent on edge cases relevant to regression, such as too few points, collinear/degenerate input, or whether the fit is ordinary least squares.

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?

Purpose is stated up front, followed by Args/Returns/Examples in a conventional, scannable layout with no filler. The example is worth its space, though the Returns section partially overlaps with what the example already demonstrates.

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

Completeness4/5

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

There is no output schema, so the description appropriately carries the return format, including the success and error shapes. For a single-parameter deterministic math function this is nearly complete; only edge-case behavior for invalid or insufficient data is unstated.

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 0% and no parameter descriptions exist, but the tool has only one argument and the description fully specifies it as a list of (x, y) coordinate tuples, including positional meaning. That is sufficient for correct invocation, though it does not specify minimum length or duplicate-x handling.

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 names a specific operation (linear regression) and states exactly what it produces (slope and intercept), which cleanly distinguishes it from siblings like correlation_coefficient, mean, or variance that also consume numeric point data.

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?

It explains what the tool computes but never says when to choose it over alternatives such as correlation_coefficient or a general 'calculate' tool. No preconditions, fitting-method notes, or exclusion criteria are given.

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