Skip to main content
Glama

Stat Correlation Matrix

stat_correlation_matrix

Compute a correlation matrix across several variables with optional p-value correction for exploratory screening or paper-ready correlation tables.

Instructions

Correlation matrix across several variables, optionally with p-value correction.

WHEN TO USE: exploratory screening across a set of variables, or a correlation table for a paper.

WHEN NOT TO USE: as a basis for causal claims, or when the number of variables is large relative to n — correlations become unstable.

With more than two variables, always pass padjust (e.g. "fdr_bh"). A matrix of 10 variables implies 45 comparisons; several will be significant by chance alone.

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": {
      "name": "<name>",
      "columns": "<columns>"
    },
    "name": "stat_correlation_matrix"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameYes
methodNopearson
columnsYes
padjustNo
decimalsNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.9/5.0
Behavior4/5

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

With no annotations, the description carries the burden and does disclose real behavioral traits: multiplicity inflation when many variables are tested, and instability when variables outnumber or crowd n. It does not state distributional assumptions (normality/linearity) or what the returned matrix contains, though an output schema exists to cover the latter.

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?

Front-loaded with the one-line purpose, then clearly delimited WHEN TO USE / WHEN NOT TO USE blocks, then the operational rule. The 45-comparisons sentence is not padding; it justifies the padjust requirement.

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?

The output schema means return values need no explanation, and the statistical caveats are well covered. But with 0% schema coverage on 5 parameters, an agent still cannot determine valid `method` values or what `columns` expects, which is a material gap for correct invocation.

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

Parameters2/5

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

Schema description coverage is 0% across 5 parameters, so the description must compensate and it largely does not. It adds genuine meaning only for `padjust`, including a usable example value "fdr_bh"; `method` (default pearson) is never shown to accept spearman/kendall, and `columns`, `name`, and `decimals` get no explanation at all.

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?

The first sentence names a specific verb+resource+shape: a correlation matrix across several variables with optional p-value correction. That distinguishes it in practice from pairwise correlation siblings, but no sibling (e.g. stat_correlation, stat_partial_correlation) is named explicitly, so differentiation is inferred rather than stated.

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?

Explicit WHEN TO USE (exploratory screening, correlation table for a paper) and WHEN NOT TO USE (causal claims, many variables relative to n). It also gives a conditional rule: with more than two variables, always pass padjust, with a worked rationale of 45 comparisons for 10 variables.

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