Skip to main content
Glama

Check sample ratio

check_srm
Read-only

Tests observed arm counts against intended weights with a chi-square check to detect sample ratio mismatch in experiments.

Instructions

Chi-square test of observed arm counts against intended weights.

A mismatch means the counts are unlikely given the weights. It does not identify the cause.

Input Schema

NameRequiredDescriptionDefault
alphaNoMismatch threshold. 0.001 is the usual SRM bar.
countsYesObserved assignments per arm.
expected_weightsYesIntended traffic weights. Must sum to 1 and match the count keys.

Output Schema

NameRequiredDescriptionDefault
alphaYes
countsYes
p_valueYes
mismatchYes
chi_squareYes
expected_countsYes
expected_weightsYes
degrees_of_freedomYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.5/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true and openWorldHint=false, so safety is covered. The description adds genuine value with the caveat that a mismatch does not identify a cause, but says nothing about minimum sample size requirements or how borderline results near alpha should be interpreted.

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 short sentences with zero waste; the operation is front-loaded and the interpretation caveat follows. Every sentence earns its place.

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?

An output schema and full annotation coverage reduce the burden, but the description still lacks the when-to-use context and sample-size expectations an agent needs to decide whether to call this versus power_calc. Adequate, not complete.

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%, including the alpha default and its 'usual SRM bar' note, so the schema carries the parameter burden and baseline 3 applies. The description adds no meaning about counts or expected_weights beyond the schema.

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?

States a specific verb and resource: a chi-square test of observed arm counts against intended weights. An agent can tell this apart from power_calc or analyze_lift. Minor gap: the tool name's abbreviation (SRM) is never expanded, so the domain term is only implied by 'A mismatch means...'.

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?

Usage is implied by the statistical operation but there is no explicit when-to-use, no prerequisites, and no routing to siblings such as power_calc or assign_cells. The only guidance given is interpretive (a mismatch does not identify the cause), not procedural.

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