Skip to main content
Glama

openfda

Search FDA drug labels, adverse events, and enforcement reports with field:term queries to retrieve JSON records for drug safety and recall research.

Instructions

Search openFDA drug labels, adverse events or enforcement reports.

query is an openFDA search expression (field:term), for example openfda.brand_name:"advil" or indications_and_usage:"pain" for labels, patient.drug.medicinalproduct:"ibuprofen" for events, and reason_for_recall:"contamination" for enforcement. No matches are a normal count: 0, not an error.

Records are upstream JSON and can be large (a drug label is ~10 KB), so the default limit is 3; keep it small. An optional free OPENFDA_API_KEY raises rate limits but is not required.

Args: query: openFDA search expression. endpoint: "drug/label", "drug/event" or "drug/enforcement". limit: Records to return, 1-10 (default 3). skip: Records to skip, 0-1000.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "query": "<query>"
    },
    "name": "openfda"
  }
}

Input Schema

NameRequiredDescriptionDefault
skipNo
limitNo
queryYes
endpointNodrug/label

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.9/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does so well: it discloses that no matches yield a normal 'count: 0' rather than an error, that records are large (~10 KB per label) so the default limit is 3, and that OPENFDA_API_KEY is optional but raises rate limits. This is the kind of behavioral context annotations would otherwise supply; only pagination mechanics via 'skip' and response shape are left implicit.

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?

Front-loaded with the purpose, then the query examples, then the behavioral caveats about result size and rate limits, so the highest-value information comes first. The trailing Args block partially repeats the prose, but it is compact and serves as a scannable parameter reference rather than filler.

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 4-parameter tool with no annotations and no output schema, the description covers what matters for a correct call: query syntax, endpoint selection, size limits, empty-result semantics, and optional auth. It does not describe what a returned record looks like beyond 'upstream JSON', which is the main remaining gap.

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 description coverage is 0%, so the description must compensate, and it largely does: query format and per-endpoint examples, the three valid endpoint values (functioning as an enum absent from the schema), the limit range 1-10 with default 3, and the skip range 0-1000 are all documented. It omits that the endpoint default is 'drug/label' and gives no query syntax for operators or field names beyond the examples.

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 opens with a specific verb+resource: 'Search openFDA drug labels, adverse events or enforcement reports,' and names the three endpoints. It is easy to separate from protein/gene/chemistry siblings, though it does not acknowledge the closest lookalike, dailymed, which also serves drug labeling data.

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?

Usage context is implied rather than stated: choosing the endpoint is explained, and per-endpoint query examples ('openfda.brand_name:"advil"' for labels, 'patient.drug.medicinalproduct' for events, 'reason_for_recall' for enforcement) effectively tell an agent which endpoint fits which question. However, there is no explicit statement of when to prefer this tool over a sibling, and no when-not guidance.

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