Skip to main content
Glama

Stat Partial Correlation

stat_partial_correlation

Calculates the partial correlation between two variables while controlling for covariates, revealing their association net of those factors.

Instructions

Partial correlation — association between two variables after removing covariates.

WHEN TO USE: a third variable plausibly drives both x and y, and you want the association net of it.

WHEN NOT TO USE: as a substitute for modelling. If several covariates are involved, regression gives a clearer picture. Partial correlation also assumes the covariate is measured without error.

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>",
      "x": "<x>",
      "y": "<y>",
      "covar": "<covar>"
    },
    "name": "stat_partial_correlation"
  }
}

Input Schema

NameRequiredDescriptionDefault
xYes
yYes
nameYes
covarYes
methodNopearson

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 full burden, and it does disclose a key modeling assumption (the covariate must be measured without error) and cautions against overuse. It stops short of stating computational behavior such as the default method or that the operation is a pure read with no side effects.

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 definition followed by two labelled sections; every sentence adds information and nothing is repeated from the schema or annotations.

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 explained, and the statistical caveats are well covered. The missing piece is parameter-level guidance for a tool whose schema has zero description coverage, which is a real gap for a five-parameter call.

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 five parameters, yet the description never mentions x, y, covar, name, or method. An agent must open the schema to learn that covar is an array of strings or that method defaults to pearson; the description offers no compensating meaning.

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 line gives a precise definition — association between two variables after removing covariates — which is more informative than the bare tool name. It does not, however, explicitly contrast itself with the sibling stat_correlation or stat_correlation_matrix, leaving the agent to infer the distinction.

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?

Provides an explicit WHEN TO USE condition (a third variable plausibly drives both x and y) and a WHEN NOT TO USE condition, plus a named alternative (regression) for the multi-covariate case. This is exactly the routing guidance an agent needs.

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