Skip to main content
Glama

pubmed_batch_fetch

Fetch PubMed records in batches from long PMID lists or NCBI Entrez History, chunking requests up to batch size for complete retrieval.

Instructions

Batch fetch PubMed records in chunks supporting long PMID lists (>200) or NCBI Entrez History.

Supports two retrieval modes:

  1. Direct PMID batching: Accepts an arbitrary list of PMIDs, chunking them into batch_size (max 200).

  2. Entrez History batching: Accepts webenv and query_key from a prior pubmed_search(..., use_history=True), iterating retstart up to total_records in chunks of batch_size.

Args: pmids: Optional list of PMIDs (arbitrary length; chunked into batch_size). webenv: Optional NCBI WebEnv token from a prior pubmed_search(..., use_history=True). query_key: Optional NCBI QueryKey token from a prior pubmed_search. retstart: Starting offset for pagination (default 0). total_records: Total records to retrieve in Entrez History mode (if omitted, queries history count). batch_size: Number of records per chunk (1-200, default 200).

Returns: Comprehensive batch execution report, per-batch results, per-record statuses ('status': 'success'), not_found PMIDs, and audit provenance.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pmidsNo
webenvNo
retstartNo
query_keyNo
batch_sizeNo
total_recordsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A4.4/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 substantial work: it discloses chunking into batch_size, the 1-200 cap, retstart pagination up to total_records, the fallback of querying the history count when total_records is omitted, and the per-record status/not_found reporting. It omits auth/API-key requirements and NCBI rate-limit behavior, which matter for large batches.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded one-line summary followed by organized mode, Args, and Returns sections; all content is relevant. Minor redundancy where the chunking/max-200 rule is stated in both the intro and the batch_size entry.

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 two-mode, six-parameter tool with no annotations and no output schema, the description covers modes, prerequisites, parameter meanings, and return shape, which is close to sufficient. Missing only operational caveats such as token expiry, rate limits, and error behavior.

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 0%, so the description must compensate, and it does: every one of the six parameters is explained with meaning, defaults, and ranges (batch_size 1-200 default 200, retstart default 0, total_records fallback, webenv/query_key provenance). This is meaningfully richer than the bare 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?

States a specific verb+resource (batch fetch PubMed records) plus the differentiating scope: long PMID lists (>200) and Entrez History retrieval. An agent can distinguish it from pubmed_fetch/pubmed_get, which have no such batching framing.

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?

Gives clear mode-selection conditions: direct PMID batching when you have an arbitrary PMID list, versus Entrez History mode when webenv/query_key come from a prior pubmed_search(..., use_history=True). It stops short of explicitly stating when to prefer this over pubmed_fetch for small lists, so no true exclusion rule.

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