Skip to main content
Glama

UK Data: Maths and statistics

chi_square_independence_test

Read-onlyIdempotent

Performs a Chi-Square test for independence on a 2x2 contingency table. Returns the chi-square statistic, p-value, and whether to reject the null hypothesis at the given significance level. (cost: 1 credit)

Input Schema

NameRequiredDescriptionDefault
contingency_tableNo2D array, required, 2x2 table of observed frequencies [[a, b], [c, d]]
significance_levelNonumber, required, significance level for the test (e.g., 0.05 for 5%)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4/5.0
Behavior4/5

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

Annotations already cover the safety profile (read-only, idempotent, non-destructive), so the description focuses on useful extras: the 2x2 size restriction, the exact returned values including the reject/fail-to-reject decision, and a cost of 1 credit. It does not state behavior for invalid or degenerate tables, which keeps it off a 5.

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 what the tool computes, followed by what it returns and its cost. No redundant or filler wording.

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

Completeness4/5

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

For a low-complexity, low-parameter tool with no output schema, the description supplies both the computation and the return values, which is most of what an agent needs. It omits input-validation behavior for malformed or zero-cell tables, a minor remaining gap.

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%, with both parameters documented including the [[a, b], [c, d]] layout and a 0.05 significance example, so the baseline of 3 applies. The description only restates the 2x2 table shape and 'given significance level' without adding format or edge-case semantics 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?

States a specific statistical verb and resource ('Chi-Square test for independence on a 2x2 contingency table') and immediately names the outputs. No sibling tool performs a chi-square test, so the name-plus-description pair is unambiguous against the surrounding calculator tools.

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 context is implied by the '2x2 contingency table' restriction and the 'reject the null hypothesis' framing, so a knowledgeable agent knows when it applies. However, there is no explicit when-to-use/when-not guidance (e.g., minimum expected cell counts, what to do for larger tables) or pointer to any alternative tool.

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