Skip to main content
Glama

pearson_correlation

Read-onlyIdempotent

Assess linear correlation between two paired variables with a hypothesis test, returning r, df, p-value, confidence interval, and citation.

Instructions

Test for a linear association between two paired variables -- e.g. "does hours studied predict test score?" statistic is r itself (in [-1, 1]), not a t-statistic. Returns r, df (n-2), a two-tailed p-value (H0: r=0), a confidence interval for r via the Fisher z-transform, a citation, and warnings. Use spearman_correlation instead if the relationship may be monotonic but not linear, or if outliers shouldn't dominate the result. Use simple_linear_regression instead for the actual slope (units of y per unit of x), not just the strength of association.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
xYesfirst variable, one value per observation
yYessecond 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.4/5.0
Behavior4/5

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

The annotations already report readOnlyHint, idempotentHint, and destructiveHint false. The description supplements this by disclosing that the statistic is r, not a t-statistic, and describes the returned r, df, two-tailed p-value, Fisher z-transform CI, citation, and warnings. Minor context around assumptions is left implicit.

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?

Each sentence in the description carries useful content: the method's purpose, the statistic produced, the returns, and the alternatives. The description is dense but not bloated, with no filler or repetition of schema content.

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?

Without an output schema, the description compensates by enumerating the return values and statistical meaning. It also names alternatives to guide selection. Complete enough for the agent, though details like assumptions or handling of non-finite values are left out.

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?

The schema covers all three parameters (x, y, alpha) with descriptions, so the description does not need to repeat those details. It does add the notion of 'paired variables' and an example, but it does not add semantic detail about alpha beyond the schema. This is a solid baseline 3.

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 identifies a specific statistical operation: test for a linear correlation between paired variables. It explicitly says the statistic is r and enumerates the returned values, which clearly distinguishes it from other correlation and regression tools.

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?

Usage guidance is strong and direct: use spearman_correlation instead for monotonic non-linear relationships or when outliers should not dominate, and use simple_linear_regression to get the actual slope. This gives the agent clear when-to-use and when-not-to-use 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