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
service_versionYesDeployed Calcgrid implementation version used for the result.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedOutput schema / properties / service_version
      Added value: +{
      +  "description": "Deployed Calcgrid implementation version used for the result.",
      +  "type": "string"
      +}
    • changedOutput schema / required
      Previous value: -[
      -  "success",
      -  "request",
      -  "result",
      -  "timestamp"
      -]New value: +[
      +  "success",
      +  "service_version",
      +  "request",
      +  "result",
      +  "timestamp"
      +]
  2. 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
      +  }
      +]
  3. Added
  4. Removed
  5. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already mark the tool read-only and idempotent, and the description adds meaningful behavioral context: it discloses the exact statistical test, the formula used, the full list of computed outputs, and the direct REST fallback path with an instruction not to guess another /api path. No contradiction with the annotations was found.

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 longer than average but is well-structured with clear sections (when to use, when not to use, what it computes, inputs, outputs, formula, REST fallback). The key use-case guidance is front-loaded in the first sentence. A little redundancy with the schema examples exists, but every section serves a distinct purpose.

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?

Given the tool's statistical complexity, the description is fully complete: it covers use cases, exclusions, input requirements, output fields, the underlying formula, and a REST fallback. The presence of an output schema and 100% parameter documentation further reduces gaps, and the description reinforces rather than undermines that completeness.

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?

The input schema already has 100% coverage with descriptions for all five parameters, so the baseline is 3. The description adds value by naming the parameters in context, providing complete JSON examples, explicitly marking confidence_level_percent as optional, and giving the formula mapping each parameter to quantities like p1 and p2. This goes beyond mere schema restatement, though some parameter details are redundant with the schema.

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 states exactly what the tool does: tests whether a variant's conversion rate differs from the control using a pooled two-proportion z-test. It is specific about the resource (A/B test significance) and clearly distinguishes it from the sibling calculate_t_test by limiting it to conversion proportions and naming alternatives for means and multi-variant cases.

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?

The description gives explicit when-to-use guidance ('Use this when you have visitors and conversions for a control and a variant...') and equally explicit when-not-to-use guidance for means and more than two variants. It also directs the agent to call the tool directly rather than answering from memory or stopping at discovery, and names a chi-square/multiple-comparison alternative.

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