Skip to main content
Glama
lzinga

US Government Open Data MCP

fda_count

Read-only

Count top terms in any OpenFDA endpoint by specifying a field. Use '.exact' suffix for full phrase counts.

Instructions

Count/aggregate any OpenFDA endpoint by a specific field. Returns top terms with counts. Works on ALL FDA endpoints. IMPORTANT: Use '.exact' suffix for full phrase counts (e.g. 'brand_name.exact'). Without '.exact', multi-word values like 'Class III' are split into separate word counts.

Endpoints: drug/event, drug/label, drug/ndc, drug/enforcement, drug/drugsfda, drug/shortages, device/event, device/510k, device/classification, device/enforcement, device/recall, device/pma, device/udi, food/enforcement, food/event, animalandveterinary/event, tobacco/problem.

Example count_field values per endpoint:

  • drug/ndc → pharm_class.exact, dea_schedule, dosage_form.exact

  • drug/shortages → update_type, status.exact, therapeutic_category.exact

  • device/510k → country_code, advisory_committee, clearance_type.exact

  • tobacco/problem → tobacco_products.exact, reported_health_problems.exact

  • food/event → reactions.exact, outcomes.exact

  • animalandveterinary/event → animal.species.exact, primary_reporter.exact

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
endpointYesOpenFDA endpoint path (e.g. 'drug/ndc', 'device/510k', 'tobacco/problem')
count_fieldYesField to count. Use '.exact' for full phrases (e.g. 'pharm_class.exact')
searchNoOptional search filter to narrow results before counting
limitNoMax count results (default: API default)
Behavior5/5

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

Annotations already declare readOnlyHint=true, and the description adds behavioral details like the '.exact' suffix for full phrase counts and the fact that it works on all endpoints. No contradictions; the description enriches the agent's understanding 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 well-structured and front-loaded with the core purpose, followed by the critical '.exact' note, endpoint list, and examples. Every sentence adds value without redundancy, achieving conciseness while being informative.

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?

Despite no output schema, the description clearly states that the tool returns 'top terms with counts,' which is sufficient for an aggregation tool. It covers all aspects: purpose, usage nuance, parameters, and examples, enabling confident invocation.

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

Parameters5/5

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

Schema description coverage is 100%, and the description adds example values per endpoint (e.g., 'pharm_class.exact' for drug/ndc), which explains how to use parameters effectively. The 'search' and 'limit' parameters are also contextually explained through examples, adding significant meaning 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?

The description clearly states it counts/aggregates any OpenFDA endpoint by a specific field and returns top terms with counts. It explicitly says 'Works on ALL FDA endpoints', which distinguishes it from sibling tools that target specific endpoints (e.g., fda_drug_events, fda_device_510k).

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 usage guidelines, including the important '.exact' suffix behavior and example count_field values for various endpoints. It implies when to use this tool (aggregate counting) versus raw data retrieval from sibling tools, though it doesn't explicitly state when not to use it.

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/lzinga/us-gov-open-data-mcp'

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