Skip to main content
Glama

A/B Test Sample Size Calculator MCP

A/B test sample size calculator

calculate_sample_size
Read-onlyIdempotent

Exact sample size per variant for an A/B test on a conversion rate (two independent proportions): baseline rate, minimum detectable effect (relative or absolute), alpha, power, one or two-sided, several variants with optional Bonferroni, and unequal allocation. Uses the pooled/unpooled normal formula (same as R power.prop.test) and also reports the figure Evan Miller's calculator gives, so the two can be reconciled.

Input Schema

NameRequiredDescriptionDefault
mdeYesMinimum detectable effect. Relative by default (0.10 = a 10% lift); set mde_type "absolute" for percentage points as a proportion (0.01 = 1 point).
alphaNoSignificance level, default 0.05.
powerNoStatistical power, default 0.80.
sidedNotwo-sided (default) or one-sided test.two
mde_typeNorelative (default) or absolute.relative
variantsNoNumber of arms including control. 2 = A/B, 3 = A/B/C.
bonferroniNoSplit alpha across the variant-vs-control comparisons (Bonferroni).
baseline_rateYesControl conversion rate as a proportion, for example 0.042 for 4.2%.
allocation_ratioNoUsers in each variant per user in control. 1 = even split.

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 that this is a safe read-only, idempotent, non-destructive operation. Beyond that, the description adds meaningful methodological transparency: the pooled/unpooled normal formula, comparison to power.prop.test, and reconciliation with Evan Miller's calculator output. It does not explain output structure in detail, but the statistical behavior is well disclosed.

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?

The description is front-loaded with the core purpose and then layers in method and output context. It is dense and slightly run-on, but every clause carries relevant information, so it is appropriately concise for a statistical calculator.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

There is no output schema, so the description must carry some return-value context. It does so by stating that the tool reports exact per-variant sample size and the corresponding Evan Miller figure, though it does not describe the full output shape or units in detail. For a 9-parameter calculator, it is mostly complete but leaves some output clarity implicit.

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 100%, so all nine parameters are already documented in the input schema. The description mentions the same parameter concepts at a high level, including baseline rate, MDE type, alpha, power, sidedness, variants, Bonferroni, and allocation, but it does not add syntax, edge-case, or default-value detail beyond what the schema provides.

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 states a specific verb and resource: calculating exact per-variant sample size for an A/B test on a conversion rate using two independent proportions. It clearly distinguishes itself from generic statistical tools by naming the method, but it does not explicitly contrast itself with sibling tools such as estimate_test_duration.

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?

The description implies when the tool is appropriate by listing supported scenarios: relative or absolute MDE, multiple variants, Bonferroni correction, and unequal allocation. However, it gives no explicit guidance about when to use this instead of estimate_test_duration or other siblings.

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.