Skip to main content
Glama

APJ RAISE Research

Power analysis (sample size for a test)

power_analysis
Read-only

Calculates the sample size needed to detect an effect with a statistical test (a priori power analysis, matches G*Power to within 1–2 participants). Designs: two_group_t_test (Cohen's d), paired_t_test (d), one_sample_t_test (d), correlation (r), anova (Cohen's f, k groups), two_proportions (p1, p2). If the user does not know the effect size, use the conventional "medium" effect and say so.

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": {
      "design": "<design>"
    },
    "name": "power_analysis"
  }
}

Input Schema

NameRequiredDescriptionDefault
p1Notwo_proportions only: proportion in group 1 (0–1).
p2Notwo_proportions only: proportion in group 2 (0–1).
alphaNoDefault 0.05.
powerNoDefault 0.80.
designYes
groupsNoanova only: number of groups. Default 3.
dropoutNoExpected dropout %, to inflate the sample. Default 0.
effect_sizeNoCohen's d (t-tests), r (correlation) or f (ANOVA). Small/medium/large: d .2/.5/.8, r .1/.3/.5, f .1/.25/.4.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already establish readOnlyHint=true and destructiveHint=false, so the safety profile is covered. The description still adds real behavioral context: it is an a priori power analysis and its results match G*Power to within 1-2 participants, plus a fallback policy for unknown effect sizes. It stops short of describing what the returned sample size represents (per group vs. total) or how dropout inflation affects it.

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?

Two sentences, front-loaded with the purpose and then the design catalog, with no wasted wording. The conditional fallback instruction is compact and placed at the end where it belongs.

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?

For an eight-parameter tool with one required field, the description covers purpose and the hardest user decision (unknown effect size) well. However, with no output schema, it never states what is returned - per-group versus total N, or how the dropout parameter changes the reported figure - leaving a real gap.

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 description coverage is 88%, so the schema already documents all eight parameters including the effect-size conventions (.2/.5/.8, .1/.3/.5, .1/.25/.4). The description largely repeats the schema's design-to-effect-size mapping, adding only a marginal note that anova takes k groups. Baseline 3 applies since the schema does the heavy lifting.

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 description opens with a specific verb and resource ('Calculates the sample size needed to detect an effect with a statistical test') and enumerates the six supported designs with their effect-size measures, so an agent knows exactly what the tool computes. It does not explicitly differentiate itself from the sibling 'sample_size' or 'effect_size' tools, which keeps it just short of a 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives one concrete usage rule: when the user does not know the effect size, fall back to the conventional 'medium' value and state that assumption. There is no guidance on when to pick this tool over the siblings nor any prerequisites, so usage is only partially covered.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources