Skip to main content
Glama

Fda Event Counts

fda_event_counts
Read-onlyIdempotent

Aggregate adverse events by reaction type, patient age, or outcome. Returns top reactions for a drug and event trends over time.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesOpenFDA search query to filter events before counting. Same syntax as fda_drug_events.
count_fieldYesField to count/aggregate by. Examples: "patient.reaction.reactionmeddrapt.exact" (top reactions), "receivedate" (timeline), "serious" (severity breakdown), "patient.drug.openfda.brand_name.exact" (co-reported drugs)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesThe search query used to filter events
resultsYesArray of count results by term
count_fieldYesThe field aggregated/counted by
requested_queryNoThe search query as supplied, when it differs from the resolved query in `query`
reaction_resolvedNoThe MedDRA preferred term actually used for the filter
reaction_requestedNoThe reaction term as the caller supplied it, uppercased
reaction_resolutionNoHow the supplied reaction term mapped onto a MedDRA preferred term. not_a_meddra_preferred_term means the filter matched nothing — counts are zero because the term missed, not because no reports exist
reaction_resolution_hintNoPresent when the term matched nothing; names a working way to discover the real preferred terms
reaction_resolution_noteNoPresent when word order was corrected; states the substitution made

Schema Changelog

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

  1. Changed1 schema field changed
    • changedInput schema / examples
      Previous value: -[
      -  {
      -    "count_field": "patient.reaction.reactionmeddrapt.exact",
      -    "query": "patient.drug.openfda.brand_name:\"ASPIRIN\""
      -  },
      -  {
      -    "count_field": "receivedate",
      -    "query": "serious:1+AND+receivedate:[20230101+TO+20231231]"
      -  }
      -]New value: +[
      +  {
      +    "count_field": "patient.reaction.reactionmeddrapt.exact",
      +    "query": "patient.drug.openfda.brand_name:\"ASPIRIN\""
      +  },
      +  {
      +    "count_field": "receivedate",
      +    "query": "serious:1+AND+receivedate:[20230101+TO+20231231]"
      +  },
      +  {
      +    "count_field": "patient.patientonsetage",
      +    "query": "patient.drug.openfda.generic_name:\"MONTELUKAST\""
      +  }
      +]
  2. Changed6 schema fields changed
    • addedOutput schema / properties / reaction_requested
      Added value: +{
      +  "description": "The reaction term as the caller supplied it, uppercased",
      +  "type": "string"
      +}
    • addedOutput schema / properties / reaction_resolution
      Added value: +{
      +  "description": "How the supplied reaction term mapped onto a MedDRA preferred term. not_a_meddra_preferred_term means the filter matched nothing — counts are zero because the term missed, not because no reports exist",
      +  "enum": [
      +    "exact_match",
      +    "word_order_corrected",
      +    "not_a_meddra_preferred_term"
      +  ],
      +  "type": "string"
      +}
    • addedOutput schema / properties / reaction_resolution_hint
      Added value: +{
      +  "description": "Present when the term matched nothing; names a working way to discover the real preferred terms",
      +  "type": "string"
      +}
    • addedOutput schema / properties / reaction_resolution_note
      Added value: +{
      +  "description": "Present when word order was corrected; states the substitution made",
      +  "type": "string"
      +}
    • addedOutput schema / properties / reaction_resolved
      Added value: +{
      +  "description": "The MedDRA preferred term actually used for the filter",
      +  "type": "string"
      +}
    • addedOutput schema / properties / requested_query
      Added value: +{
      +  "description": "The search query as supplied, when it differs from the resolved query in `query`",
      +  "type": "string"
      +}
  3. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "count_field": {
      +      "description": "The field aggregated/counted by",
      +      "type": "string"
      +    },
      +    "query": {
      +      "description": "The search query used to filter events",
      +      "type": "string"
      +    },
      +    "results": {
      +      "description": "Array of count results by term",
      +      "items": {
      +        "properties": {
      +          "count": {
      +            "description": "Number of occurrences",
      +            "type": "number"
      +          },
      +          "term": {
      +            "description": "The term/value counted",
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "term",
      +          "count"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    }
      +  },
      +  "required": [
      +    "query",
      +    "count_field",
      +    "results"
      +  ],
      +  "type": "object"
      +}
  4. Changed1 schema field changed
    • addedInput schema / examples
      Added value: +[
      +  {
      +    "count_field": "patient.reaction.reactionmeddrapt.exact",
      +    "query": "patient.drug.openfda.brand_name:\"ASPIRIN\""
      +  },
      +  {
      +    "count_field": "receivedate",
      +    "query": "serious:1+AND+receivedate:[20230101+TO+20231231]"
      +  }
      +]
  5. First observed

TDQS

A3.6/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, openWorldHint, idempotentHint, and non-destructive behavior, so the safety profile is covered. The description adds that the tool produces aggregated counts rather than raw events, which is useful context. It does not disclose any additional behavioral traits such as pagination, limits, or exact grouping semantics, but the output schema partially covers that.

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 two tight sentences with no filler. The central aggregation behavior is front-loaded, and the return summary is stated efficiently. Every sentence contributes useful information.

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?

With two required parameters, 100% schema coverage, rich examples, an output schema, and annotations covering the safety profile, the description is largely sufficient. The main missing element is explicit guidance for distinguishing this tool from overlapping FAERS siblings, but that is more of a usage-guideline gap than a completeness gap for invocation.

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 both query and count_field with examples. The description names aggregation dimensions like 'reaction type, patient age, or outcome,' which loosely maps to count_field examples, but it does not add meaningful syntax or format details beyond the schema. This matches the baseline of 3.

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?

The description uses a specific verb and resource: 'Aggregate adverse events by reaction type, patient age, or outcome.' It clearly says what the tool does and what it returns. However, it does not explicitly differentiate itself from closely related siblings like fda_faers_trend or fda_faers_reaction_profile, which also cover reactions and trends.

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 phrase 'Aggregate adverse events' implies this tool should be used when counts or grouped summaries are needed rather than raw event lists. There is no explicit guidance about when to choose this tool over overlapping siblings such as fda_faers_trend or fda_faers_reaction_profile. The usage context is present but only by implication.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

TDQS

A4/5.0
Disambiguation4/5

Most tools have distinct names and purposes, but the large number of meta-tools (e.g., ask_pipeworx variants, deep_research) and overlapping research/scanning tools (entity_profile, compare_entities, recent_changes) could cause confusion. An agent may need to carefully read descriptions to choose correctly.

Naming Consistency3/5

Snake_case is prevalent but not universal. FDA tools are consistently named with 'fda_' prefix, but there are single-word verbs (remember, recall), camelCase is absent, and some tool names are long and descriptive (scan_competitor_ai_presence). The mix of patterns is readable but not highly consistent.

Tool Count3/5

43 tools is high and includes both dedicated tools and meta-tools that can access thousands more. There is redundancy (e.g., FDA data can be retrieved via fda_drug_approvals or ask_pipeworx). The scope is broad, but many tools could be consolidated. Count feels borderline excessive for the apparent purpose.

Completeness4/5

FDA coverage is excellent with tools for approvals, labels, events, recalls, shortages, warning letters, etc. Other domains (financial, betting, npm) are covered by meta-tools, providing breadth. However, dedicated non-FDA tools are sparse, and the server relies heavily on the universal query tools for completeness.