Skip to main content
Glama

Query NIAID Data Ecosystem

niaid_data_query
Read-onlyIdempotent

Search the NIAID Data Ecosystem for datasets, clinical studies, and publications. Use Elasticsearch queries to find, filter, and aggregate biomedical research resources.

Instructions

Search the NIAID Data Ecosystem for biomedical research resources.

Queries the NIAID Data Ecosystem API (https://data.niaid.nih.gov), which indexes datasets, clinical studies, publications, and other research resources related to infectious and immune-mediated diseases funded or supported by NIAID.

Supports Elasticsearch query string syntax for powerful full-text and field-specific searches. Results include datasets, clinical trials, repositories, computational tools, and more.

Args: params (QueryInput): Validated input parameters containing: - q (str): Elasticsearch query string. Use '' for all records. Supports field-specific syntax: 'name:COVID', 'author.name:Smith', '@type:Dataset', 'conditionsOfAccess:Open'. Default: ''. - size (Optional[int]): Number of results per page (1-1000). Default: 10. - offset (Optional[int]): Results to skip for pagination. Default: 0. - sort (Optional[str]): Sort field; prefix with '-' for descending (e.g., '-date'). Default: relevance score. - fields (Optional[str]): Comma-separated fields to return (e.g., 'name,description,@type,date'). Returns all fields if omitted. - aggs (Optional[List[str]]): Fields to aggregate/facet by (e.g., ['@type', 'conditionsOfAccess']). Useful for summarizing result distributions without reading each record. - facet_size (Optional[int]): Max aggregation buckets per field. Default: 10. - explain (Optional[bool]): Include relevance score explanation. - response_format (ResponseFormat): 'markdown' (default) for readable summaries or 'json' for complete structured data.

Returns: str: Formatted search results.

Markdown response includes:
- Total result count and pagination info
- For each hit: name, type, ID, score, description (truncated), URL, date
- Aggregation summaries (if aggs requested)

JSON response schema:
{
    "total": int,           # Total matching records
    "count": int,           # Records in this response
    "offset": int,          # Current pagination offset
    "has_more": bool,       # Whether more results are available
    "next_offset": int | null,  # Offset for next page
    "took_ms": int,         # Query time in milliseconds
    "hits": [...],          # Full record objects from the API
    "aggregations": {...}   # Aggregation buckets (if requested)
}

Error response: "Error: <message with suggested fix>"

Examples: - Use when: "Find open-access COVID-19 datasets" -> params with q='COVID-19 AND @type:Dataset AND conditionsOfAccess:Open' - Use when: "What types of resources are available?" -> params with q='*', aggs=['@type'], size=0 - Use when: "Find datasets with access conditions distribution" -> params with q='@type:Dataset', aggs=['conditionsOfAccess'], size=5 - Use when: "Search for malaria resources sorted by date" -> params with q='malaria', sort='-date', size=20 - Use when: "Page through results" (after first call with offset=0, size=10) -> params with same q, offset=10, size=10

Error Handling: - Returns "Error: Invalid query (HTTP 400)..." if query syntax is invalid - Returns "Error: Rate limit exceeded (HTTP 429)..." if too many requests - Returns "Error: Request timed out..." if query is too broad/slow

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
paramsYesInput model for the NIAID Data query operation.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

Annotations already mark it as read-only, idempotent, and non-destructive. The description adds substantial behavioral context: it calls an external API with rate limiting and timeout errors, returns formatted output (markdown or JSON), and includes pagination and aggregation details beyond the annotation hints.

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 long but well-organized into Purpose, API context, Args, Returns, Examples, and Error Handling. It front-loads the core purpose in the first sentence, and every section adds operational value without redundancy.

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?

The description includes the full JSON response schema, markdown output structure, error handling, and multiple examples. Even with the output schema present, it explains expected behaviors thoroughly, making it complete for a complex query tool.

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 coverage is 100%, but the description's Args section goes beyond the schema by adding Elasticsearch syntax examples ('name:COVID', '@type:Dataset'), explaining how 'offset' and 'size' work together for pagination, and clarifying that 'size=0' can be used with aggregations. The examples show concrete parameter combinations.

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 'Search the NIAID Data Ecosystem for biomedical research resources,' clearly stating the verb and resource. It further explains it queries the API and supports Elasticsearch syntax, but it does not explicitly contrast with sibling tools like niaid_data_get or niaid_data_summarize.

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 'Examples' section provides multiple 'Use when:' scenarios, giving explicit context for when to invoke the tool, such as 'Find open-access COVID-19 datasets' and 'What types of resources are available?'. However, it does not mention when not to use it or suggest alternatives for single-record retrieval or other sibling operations.

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/mark-aronson/niaid-data-mcp-server'

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