Skip to main content
Glama

Stat Power Analysis

stat_power_analysis

Solve for the omitted effect size, sample size, power, or alpha by supplying the other three; use it to justify sample size before data collection or report achieved power after a study.

Instructions

Power analysis — solve for whichever of effect size / n / power / alpha is omitted.

WHEN TO USE

  • Before data collection, to justify the sample size (a priori power analysis).

  • To report the achieved power of a completed study.

WHEN NOT TO USE: to compute "observed power" from the current sample's effect size and then interpret it — that is circular and adds nothing to the p-value.

Supply exactly three of the four quantities; the fourth is solved for.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "stat_power_analysis"
  }
}

Input Schema

NameRequiredDescriptionDefault
dNo
kNonumber of groups (ANOVA).
mNonumber of repeated measurements (RM-ANOVA).
nNosample size per group.
rNo
wNo
testNottest | ttest2n | anova | rm_anova | corr | chi2.ttest
alphaNosignificance level.
powerNotarget power (0.80 is the conventional threshold).
contrastNotwo-samples | one-sample | paired (for ttest).two-samples
eta_squaredNo

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 behavioral burden and delivers the key operational constraint — supply exactly three of four quantities and the fourth is solved for — which is not inferable from the schema. It does not state what happens on invalid combinations (e.g. four supplied, or two), and no annotation covers error or mutation behavior, so a small gap remains.

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?

Front-loaded with the core mechanic, then structured headers for when-to-use and when-not-to-use; every sentence carries signal. The one-line restatement of the three-of-four rule at the end duplicates intent already implied by the opening sentence, a minor redundancy.

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 tool has 11 optional parameters, no annotations, and a required test-type selection with a default of 'ttest', yet the description never explains how to choose among ttest/ttest2n/anova/rm_anova/corr/chi2 or which effect-size parameter each expects. Output values need not be described since an output schema exists, but the invocation-mapping gap is material for a tool with this many parameters.

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?

Schema coverage is 64%, with d, r, w, and eta_squared undocumented in the schema. The description groups them abstractly as 'effect size' but never maps which letter applies to which test (d for ttest, w for chi2, r for corr), nor clarifies k/m for the ANOVA variants. It adds partial meaning but does not compensate for the coverage gap.

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 verb and resource ('Power analysis') and immediately names the exact mechanic: solving for whichever of effect size / n / power / alpha is omitted. No sibling in the provided list performs power analysis, so an agent can route here without ambiguity.

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 section (a priori sample-size justification, achieved power of a completed study) and a WHEN NOT TO USE entry that names the specific misuse (post-hoc 'observed power') and explains why it is circular. This is the strongest form of guidance: positive conditions plus a named anti-pattern with rationale.

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