Skip to main content
Glama

one_proportion_z_test

Read-onlyIdempotent

Test whether an observed proportion differs from a hypothesized value using a z-test, returning z-statistic, p-value, confidence interval, and assumption warnings.

Instructions

Test whether an observed proportion (successes out of n) differs from a hypothesized proportion p0 -- e.g. "is this coin fair (p0=0.5) given 55 heads in 100 flips?" Uses the normal approximation, which degrades for small n or p0 near 0 or 1; a warning is included when that assumption looks shaky. Returns the z-statistic, two-tailed p-value, a confidence interval for the true proportion, a citation, and warnings.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nYestotal number of trials/observations
p0Yesthe hypothesized true proportion to test against, in [0, 1]
alphaNosignificance level for the test (and any confidence interval); default 0.05
successesYesnumber of successes observed

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Changed4 schema fields changedv0.3.0
    • addedInput schema / properties / alpha / description
      Added value: +"significance level for the test (and any confidence interval); default 0.05"
    • addedInput schema / properties / n / description
      Added value: +"total number of trials/observations"
    • addedInput schema / properties / p0 / description
      Added value: +"the hypothesized true proportion to test against, in [0, 1]"
    • addedInput schema / properties / successes / description
      Added value: +"number of successes observed"
  2. First observedv0.1.0

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, and non-destructive. The description adds meaningful behavioral details: it mentions the normal approximation, the warning mechanism when assumptions are shaky, and the specific return components (z-statistic, p-value, CI, citation, warnings). This adds value beyond annotations by disclosing the tool's computational nature and output expectations.

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?

The description is a single, well-organized paragraph of five sentences. It front-loads the core purpose, then covers assumptions, warnings, and return values. Every sentence provides essential information with zero redundancy or fluff, maintaining high density while remaining readable.

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 nature and the lack of an output schema, the description adequately covers what the tool returns (list of outputs) and when it should be used (assumptions). It also provides a concrete example that aids understanding. There are no significant gaps: the warning about small n and p0 boundaries is crucial, and the description mentions it, making it complete for a statistician user.

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 coverage is 100%, so all parameters (successes, n, p0, alpha) are well-documented in the schema. The description adds an intuitive example and clarifies the meaning of p0, but does not provide additional syntax or detail beyond what the schema already offers. According to guidelines, baseline is 3 for high coverage, and the description adds marginal value.

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 a specific verb ('Test whether'), identifies the exact resource ('observed proportion'), and uses an illustrative example ('is this coin fair?') that clearly distinguishes from siblings like two_proportion_z_test. It unambiguously conveys the tool's function.

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

Usage Guidelines4/5

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

The description explains the normal approximation assumption and warns about degradation for small n or extreme p0, giving clear context on when the tool is appropriate. It does not explicitly name alternatives like fisher_exact_test, but the limitation implicitly guides selection; thus it lacks explicit exclusions but provides strong contextual guidance.

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

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mrnh/rigor'

If you have feedback or need assistance with the MCP directory API, please join our Discord server