Skip to main content
Glama

Chi-Square Test

stats_chi_square
Read-onlyIdempotent

Test independence between categorical variables using a contingency table. Applies Yates' correction for 2x2 tables when enabled.

Instructions

Run a chi-square test of independence on a contingency table (Yates correction optional).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tableYes2-D contingency table of observed counts (list of rows; all rows same length; at least 2 rows and 2 columns; non-negative).
correctionNoIf True apply Yates' continuity correction (meaningful for 2x2 tables only).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
dofYesDegrees of freedom.
methodYesMethod used: 'Yates continuity correction' (2x2 with correction) or "Pearson's chi-squared".
p_valueYesp-value.
expectedYesExpected frequencies under independence.
statisticYesThe chi-square statistic.
correctionYesWhether Yates' continuity correction was applied.
Behavior3/5

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

Annotations already disclose that the tool is read-only, idempotent, and non-destructive. The description adds minimal behavioral context beyond that, only mentioning that Yates correction is optional (which also appears in the schema). No additional behaviors such as expected output or assumptions are discussed, so the description does not significantly enrich transparency beyond the annotations.

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, efficient sentence that conveys the test type, input, and an optional parameter without any filler. It is appropriately sized for the tool's simplicity.

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?

The description, combined with a rich schema (100% parameter coverage) and an existing output schema, is sufficiently complete for an agent to understand what the tool does. It does not mention statistical assumptions (e.g., expected cell counts) or return values, but the output schema covers return details, so this is not a significant 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 'table' and 'correction' parameters already documented in the schema. The description text repeats 'Yates correction optional' but adds no new meaning beyond the schema's existing parameter descriptions.

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 clearly states the specific test ('chi-square test of independence') and the input type ('contingency table'), which distinguishes it from sibling statistical tests like t-tests or correlation. The optional Yates correction is a specific detail that adds further clarity.

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 provides clear context for when to use the tool: when you have a contingency table and want to test independence. It does not explicitly mention alternatives or when not to use it, but the purpose is specific enough that the intended usage is unambiguous.

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

Install Server

Other Tools

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/madhusudan-kulkarni/biotools-mcp'

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