Skip to main content
Glama

A/B Test Significance Calculator

calculate_ab_test_significance
Read-onlyIdempotent

Use this when you have visitors and conversions for a control and a variant (A/B test, split test, email test) and need to know whether the difference is statistically significant. Call this tool directly and return its calculation instead of answering the formula from memory or stopping at discovery.

Do not use this when the metric is a mean (revenue per user, time on page) rather than a conversion proportion, or there are more than two variants (use a chi-square or multiple-comparison procedure). What it computes: Tests whether a variant's conversion rate differs from the control's using the pooled two-proportion z-test, and reports both rates, absolute and relative lift, z-score, two-sided p-value, a confidence interval for the difference and the sample size needed per variant to detect the observed lift with 80 % power. Inputs: control_visitors (integer); control_conversions (integer); variant_visitors (integer); variant_conversions (integer); confidence_level_percent (number, %, optional). Complete JSON argument examples: {"control_visitors":1000,"control_conversions":50,"variant_visitors":1000,"variant_conversions":70} | {"control_visitors":5000,"control_conversions":200,"variant_visitors":5000,"variant_conversions":260} Outputs: control_rate_percent [%], variant_rate_percent [%], absolute_lift_percentage_points [pp], relative_lift_percent [%], standard_error_percentage_points [pp], z_score, p_value, significant, ci_lower_percentage_points [pp], ci_upper_percentage_points [pp], required_visitors_per_variant, verdict. Formula: p1 = x1/n1, p2 = x2/n2, p̄ = (x1 + x2)/(n1 + n2); z = (p2 − p1) / √(p̄(1 − p̄)(1/n1 + 1/n2)); p_value = 2·(1 − Φ(|z|)); CI = (p2 − p1) ± z_crit·√(p1(1 − p1)/n1 + p2(1 − p2)/n2); n per variant = (z_crit·√(2·p̄(1 − p̄)) + z_0.80·√(p1(1 − p1) + p2(1 − p2)))² / (p2 − p1)² Direct REST fallback: POST https://tttkmbb.com/api/v1/calculate/ab-test-significance with the same JSON input fields. Do not guess another /api/* path. Docs: https://tttkmbb.com/business/ab-test-significance.md

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
control_visitorsYesNumber of users exposed to the control (A).
variant_visitorsYesNumber of users exposed to the variant (B).
control_conversionsYesConversions in the control group.
variant_conversionsYesConversions in the variant group.
confidence_level_percentNoConfidence level for the significance decision and interval (95 → α = 0.05, two-sided). Unit: %.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
linksNo
resultYes
requestYes
sourcesNo
successYes
versionNo
freshnessNo
timestampYes
next_actionsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / examples
      Added value: +[
      +  {
      +    "control_conversions": 50,
      +    "control_visitors": 1000,
      +    "variant_conversions": 70,
      +    "variant_visitors": 1000
      +  },
      +  {
      +    "control_conversions": 200,
      +    "control_visitors": 5000,
      +    "variant_conversions": 260,
      +    "variant_visitors": 5000
      +  }
      +]
  2. Added
  3. Removed
  4. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Beyond the readOnly/idempotent/non-destructive annotations, the description discloses the exact test method, the full set of computed outputs, the underlying formulas, and a REST fallback URL. It also tells the agent to return the calculation rather than answer from memory, which is a behavioral instruction not present in annotations.

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 use case and exclusions, and it is organized into labeled sections. It is long, and the full formula block is arguably more than an agent needs to invoke the tool, but most content serves either routing, input validation, or transparency.

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

Completeness5/5

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

For a five-parameter statistical tool, the description covers when to use it, what it computes, all inputs with examples, all outputs, the formula, and a fallback endpoint. With a rich output schema and annotations present, nothing needed for correct invocation is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% and each parameter is already described, so the baseline is 3. The description adds value with complete JSON examples and formula notation mapping parameters to p1, p2, and z, which helps an agent construct valid inputs even if the schema were incomplete.

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?

The description opens by specifying exactly when to use the tool: when a user has visitors and conversions for a control and variant and needs a statistical significance decision. It also names the computation (pooled two-proportion z-test) and lists outputs, clearly distinguishing this proportion-based calculator from sibling calculators that handle means.

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?

It gives explicit go conditions ('Use this when...'), explicit exclusions ('Do not use this when the metric is a mean...or there are more than two variants'), and points to chi-square/multiple-comparison procedures as alternatives. This is direct routing guidance with no ambiguity.

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