Skip to main content
Glama

compute_classical_stats

Computes classical item analysis: item difficulty, discrimination, and form reliability, with diagnostic flags to identify problematic items for review.

Instructions

Classical item analysis: difficulty, discrimination and form reliability.

Returns per item: p-value with a Wilson 95% interval, corrected point-biserial (item versus rest score -- the discrimination index to use), uncorrected point-biserial, biserial, the 27% upper-lower D index, and review flags. Returns per form: mean and SD of total score, Cronbach's alpha (identical to KR-20 here by construction), the standard error of measurement, and alpha-if-item-deleted.

REFUSES below 20 examinees and warns below 100.

Read the flags as review triggers, not verdicts. In particular, a negative corrected point-biserial on an item of ordinary difficulty usually means the item is mis-keyed rather than that it is a bad item -- the diagnostics say so explicitly when it occurs, and that warning must be relayed.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
layoutNo'wide' -- one row per examinee, one column per item. 'long' -- one row per examinee-item response, which requires `id_column` and expects `item_id` and `response` columns.wide
scoredNoTrue if the cells already hold 0/1 item scores. False if they hold the option each examinee selected (e.g. 'A', 'C'), which requires `answer_key`. This is never inferred: a raw-option file read as scored produces a complete, plausible-looking analysis of nothing. Confirm it with `describe_dataset` before trusting any statistic.
id_columnNoName of the examinee identifier column. Naming it excludes it from the item columns; leaving it unnamed makes it an extra 'item'. Identifiers are used only for exclusion and are never returned.
answer_keyNoCorrect option for each item, in the same order as the item columns. Required when `scored=False`; ignored otherwise. Its length must equal the item count -- a key that is off by one mis-scores every item after the offset, and the result looks like a form-wide item-quality problem. One entry per item, holding the option itself -- not its position, and not the whole key as a single string.
linear_formNoTrue if every examinee saw the items in column order, which is what makes a trailing run of blanks readable as not-reached. Set False for adaptive or randomised-order delivery: position is then unknown, so all blanks are treated as omits and a warning says so.
group_columnNoName of a subgroup column (demographic or otherwise). Naming it excludes it from the item columns and reports subgroup sizes. Optional here; required by `flag_dif`.
response_fileYesPath to the response file on disk, read locally. Candidate responses are passed as a path and never inline, so that a multi-thousand-examinee file does not enter the conversation transcript.
missing_policyNoHow blank responses are scored. 'omit_incorrect_notreached_missing' (default) scores a blank mid-form as incorrect -- the examinee had the opportunity -- and excludes a trailing run of blanks as not-reached, because scoring those wrong confounds item difficulty with speededness. 'all_incorrect' scores every blank wrong, which makes end-of-form items look harder and less discriminating in proportion to how speeded the form is; use it only if the scoring rules genuinely penalise unreached items. 'all_missing' excludes every blank, which conditions p-values on having attempted the item and turns items examinees skip when unsure into easy-looking ones. The two non-default policies each raise a warning.omit_incorrect_notreached_missing

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Install Server

TDQS

A4.3/5.0
Behavior5/5

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

With no annotations, the description carries the full behavioral burden, and it does so thoroughly: it discloses that the tool REFUSES below 20 examinees and warns below 100, it explains that flags are review triggers not verdicts, and it warns that a negative corrected punit-biserial on ordinary difficulty usually means mis-keying and that this warning must be relayed. It also warns against interpreting raw options as scored data.

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 longer than average but every sentence earns its place: a one-line purpose, exact output lists, hard operational thresholds, and a critical interpretation warning. It is front-loaded with the summary before the details and contains no 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?

For a tool with eight parameters, an output schema, and sibling tools, this description is remarkably complete: it states inputs implicitly, outputs explicitly, sample-size constraints, warning behavior, and how to interpret edge cases like negative discrimination. The existence of an output schema covers return structure, and nothing needed for safe invocation is missing.

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 all eight parameters in detail. The description adds useful interpretive context (e.g., corrected punit-biserial is the discrimination index to use; Cronbach's alpha equals KR-20 here), but it does not add new parameter-level meaning that the schema already lacks.

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 opens with a specific domain and output class: 'Classical item analysis: difficulty, discrimination and form reliability.' It then enumerates exact per-item and per-form statistics, so an agent knows precisely what the tool computes and can distinguish it from siblings like flag_dif or compute_local_dependence.

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?

The description strongly implies when to use the tool – when classical item-quality statistics are needed – and even gives interpretive guidance about flags. However, it never names siblings or states explicit exclusion conditions ('use flag_dif for subgroup DIF', 'use describe_dataset first'), so the routing burden falls on the agent's inference.

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

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/JulieElkinsAWS/psychometrics-mcp'

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