Skip to main content
Glama

chi_square_goodness_of_fit

Read-onlyIdempotent

Test if observed category counts match an expected distribution. Returns chi-square statistic, p-value, and warnings when expected counts are low.

Instructions

Test whether observed category counts match an expected distribution -- e.g. "are these six days-of-week signup counts evenly distributed, or skewed towards weekends?" Returns the chi-squared statistic, degrees of freedom (len-1), p-value, a citation, and a warning if any expected count is below 5 (the usual threshold below which this approximation gets unreliable).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
alphaNosignificance level for the test (and any confidence interval); default 0.05
expectedYesexpected count per category, same length and category order as observed; does not need to sum to the same total
observedYesobserved count per category

Schema Changelog

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

  1. Changed3 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 / expected / description
      Added value: +"expected count per category, same length and category order as observed; does not need to sum to the same total"
    • addedInput schema / properties / observed / description
      Added value: +"observed count per category"
  2. First observedv0.1.0

TDQS

A4.5/5.0
Behavior5/5

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

Annotations already indicate read-only, idempotent, non-destructive behavior. The description adds valuable context beyond annotations by specifying return values (chi-squared statistic, df, p-value, citation) and disclosing the expected-count-below-5 warning and approximation limitation. No contradiction.

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 sentences, front-loaded with the core purpose, followed by a concrete example and return-value/limitation details. Every sentence earns its place with no unnecessary filler.

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?

With no output schema, the description adequately explains what the tool returns and flags a key reliability caveat. The three parameters are fully documented in the schema, and the description provides enough context for an agent to select and invoke the tool correctly.

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 the schema already documents observed, expected, and alpha well. The description reinforces the concept of matching observed counts to an expected distribution and mentions the low-expected-count warning, but it does not materially add parameter syntax or constraints beyond 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 a specific statistical goal: test whether observed category counts match an expected distribution. The weekday signup example and the mention of degrees of freedom (len-1) clearly distinguish this one-way goodness-of-fit test from sibling tests like chi_square_independence.

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?

It gives a concrete example of when to use the test ('are these six days-of-week signup counts evenly distributed...'), which provides clear context. It does not explicitly name alternatives or state when not to use it, so it stops short of a 5.

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