Skip to main content
Glama

Stat Rm Correlation

stat_rm_correlation

Computes a repeated-measures correlation to measure the within-subject association between two variables when each participant contributes multiple observations, avoiding the inflation of a standard Pearson correlation.

Instructions

Repeated-measures correlation — the correct correlation for within-subject data.

WHEN TO USE: whenever each participant contributes more than one observation and you want the association between x and y.

WHEN NOT TO USE: when each participant appears once — use stat_correlation.

Why it matters: a standard Pearson correlation on repeated measures is inflated by between-subject differences. rm_corr reports the within-subject association, which is usually the quantity of interest, and tests whether within- and between-subject slopes differ.

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>",
      "subject": "<subject>"
    },
    "name": "stat_rm_correlation"
  }
}

Input Schema

NameRequiredDescriptionDefault
xYes
yYes
nameYes
subjectYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/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 behavior: it reports the within-subject association rather than the between-subject-inflated Pearson estimate, and it tests whether within- and between-subject slopes differ. It does not mention data-format expectations (long vs wide), missing-data or unbalanced-design handling, or failure modes — details that matter for a statistical procedure.

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 a one-line definition, then clearly labelled WHEN TO USE / WHEN NOT TO USE blocks and a short rationale. Every sentence adds information; nothing is padded or repeated.

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 exists, so return values need not be described, and the method-selection guidance is strong. However, for a four-parameter statistical tool with zero schema documentation, the definition leaves an agent guessing about variable naming conventions and the expected data layout, which is a meaningful gap.

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?

All four parameters (name, x, y, subject) are required and schema description coverage is 0%, so the description is the only source of parameter meaning — yet it never explains that x and y are variable names, that subject identifies the grouping/cluster variable, or what name does. The one clue is the phrase 'each participant,' which weakly implies subject's role, but the coverage gap is unaddressed.

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?

States a specific method (repeated-measures correlation) and immediately defines its scope as the within-subject association between x and y. It explicitly contrasts with the sibling stat_correlation, so an agent can distinguish the two without opening either schema.

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 (each participant contributes more than one observation) and a WHEN NOT TO USE condition with the correct alternative named (stat_correlation for single-observation designs). Nothing is left to inference.

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