Skip to main content
Glama

fisher_exact_test

Read-onlyIdempotent

Test independence in a 2x2 table using the exact hypergeometric method when chi-square assumptions fail due to small samples. Returns odds ratio, p-value, and citation.

Instructions

Test whether the row and column variables of a 2x2 contingency table are independent -- exact (via the hypergeometric distribution over all tables with the same margins), unlike chi_square_independence's chi-squared approximation. Use this instead whenever chi_square_independence warns an expected cell count is below 5, or whenever the sample is small. 2x2 tables only. Returns the sample odds ratio as statistic (can be inf/0 for a zero cell), a two-tailed p-value, a citation, and warnings.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
alphaNosignificance level for the test (and any confidence interval); default 0.05
tableYes2x2 contingency table as [[a, b], [c, d]], raw non-negative integer counts

Schema Changelog

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

  1. Addedv0.3.0

TDQS

A4.5/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 valuable behavioral context: specifies return values (odds ratio, two-tailed p-value, citation, warnings) and edge cases like inf/0 for zero cells. This is informative beyond annotations, though not exhaustive regarding caveats like ties or exact computation details.

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 succinct, front-loaded with the core purpose, and every sentence adds value: statistical method, contrast, usage guidance, constraint, and output details. No redundancy or 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?

Given the tool's complexity (statistical test) and lack of output schema, the description covers all necessary aspects: what it does, when to use it, constraints, and outputs. It provides enough context for an agent to select and invoke correctly without additional documentation.

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% for both parameters, so the description does not add significant meaning beyond the schema. It mentions '2x2 tables only' and implicitly requires non-negative integer counts, but those are already in the schema description. The description does not elaborate on alpha beyond the schema, so it adds little extra 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 clearly states the tool tests independence in a 2x2 contingency table using an exact method (hypergeometric distribution), and explicitly contrasts it with chi_square_independence. This makes the purpose unambiguous and differentiates it from siblings.

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

Usage Guidelines5/5

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

Provides explicit guidance: 'Use this instead whenever chi_square_independence warns an expected cell count is below 5, or whenever the sample is small.' Also states the limitation '2x2 tables only,' helping the agent decide when to use this tool versus alternatives.

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