Skip to main content
Glama
drvvek
by drvvek

faers_disproportionality

Read-onlyIdempotent

Compute ROR, PRR, and chi-square from a 2x2 contingency table for drug-adverse event pairs, with optional date windows, filters, and Mantel-Haenszel stratification.

Instructions

Build the 2x2 contingency table and compute ROR, PRR and chi-square.

Any date window or raw_filter is applied to all four marginals including the grand total N, so the table stays internally consistent. Screening criteria are reported individually by name rather than collapsed into a verdict.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
eventsYesOne or more MedDRA preferred terms.
date_toNoEnd of a receivedate window, YYYYMMDD. Must be paired with date_from.
date_fromNoStart of a receivedate window, YYYYMMDD. Must be paired with date_to.
drug_nameYesActive substance name, e.g. 'EMPAGLIFLOZIN'.
raw_filterNoExtra Lucene clause ANDed onto the preset query, e.g. 'patient.patientsex:2'. Applied to every marginal of a contingency table. See faers_describe_fields.
role_basisNo'any' counts every report naming the drug in any role. 'suspect_verified' is only computable where records are in hand (faers_search_cases, faers_raw_search).any
stratify_byNoAdjust for a confounder by Mantel-Haenszel pooling. Reports crude and adjusted side by side with a Breslow-Day homogeneity test. Adds 4 calls per outer band.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, destructiveHint=false and openWorldHint, so the safety profile is covered. The description adds genuinely non-annotation behavior: date/raw_filter constraints propagate to all four marginals including the grand total N to preserve internal consistency, and screening criteria are reported individually rather than collapsed into a verdict. Return format details are left to the output schema.

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 tight sentences, front-loaded with the tool's output and followed by a single clarifying paragraph on consistency and reporting semantics. Nothing is wasted or restated from structured fields.

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 7-parameter analysis tool with an output schema, annotations, and 100% schema coverage, the description supplies the key behavioral context an agent needs (marginal consistency, per-criterion output). The main remaining gap is tool-selection guidance versus faers_ebgm and faers_signal_screen.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, but the description adds real meaning beyond the schema by explaining that date window and raw_filter are applied to every marginal including the grand total. That interaction semantics is not derivable from the parameter descriptions alone. It does not, however, elaborate on role_basis or stratify_by cost/behavior beyond what the schema states.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and computational artifact ('Build the 2x2 contingency table and compute ROR, PRR and chi-square'), which is concrete and distinct from count- or search-oriented siblings. It does not, however, differentiate itself from faers_ebgm, the other disproportionality estimator in the sibling set, so an agent gets no direct comparison cue.

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

Usage Guidelines2/5

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

There is no explicit when-to-use or when-not guidance, and no alternative is named. The second paragraph describes mechanics (marginal consistency, per-criterion reporting) rather than selection criteria against faers_ebgm, faers_signal_screen, or faers_case_counts.

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