Skip to main content
Glama

Entrez Cross-Database Links

eutils_elink
Read-only

Find records linked to UIDs across NCBI databases, enabling gene-to-protein and PubMed-to-PMC mapping. Use neighbor_history to store linked UIDs for direct fetch.

Instructions

Find records linked to a set of UIDs, either in another database or within the same one.

This is how you move between databases: gene to protein, pubmed to pmc, nucleotide to snp, and so on. With cmd="neighbor_history" the linked set is stored on the NCBI History server and returned as a handle you can feed straight into eutils_efetch.

Args:

  • dbfrom (string): source database, for example "pubmed".

  • db (string, optional): target database, for example "pmc". Omit for same-database links.

  • uids (string[] | string, optional): source UIDs.

  • history (object, optional): handle whose db matches dbfrom.

  • cmd (string, optional): "neighbor" (default), "neighbor_score", "neighbor_history", "acheck", "ncheck", "lcheck", "llinks", "prlinks".

  • linkname (string, optional): a specific link, for example "pubmed_pmc". Use eutils_einfo to list them.

  • response_format ('markdown' | 'json'): output format. Default 'markdown'.

Supply either uids or history, never both.

Returns: { dbfrom, dbto?, command, groups_found, total_linked, groups: [{ dbto, linkname, count, ids[], query_key? }], histories? }

Examples:

  • Use when: "which PMC articles correspond to these PMIDs?" -> dbfrom="pubmed", db="pmc"

  • Use when: "find proteins for these gene IDs" -> dbfrom="gene", db="protein"

  • Use when: chaining a download -> cmd="neighbor_history", then pass histories to eutils_efetch

  • Don't use when: you want records, not UID lists (use eutils_link_then_fetch)

Error Handling:

  • Rejects a history whose db does not match dbfrom

  • Returns an empty result with a hint to list valid link names via eutils_einfo

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dbNoTarget database to find links in, for example "pmc". Omit to find related records in the same database.
cmdNoLink command. "neighbor" returns linked UIDs immediately (default). "neighbor_history" stores them on the History server and returns a handle.
uidsNoUIDs or accession.version identifiers, as an array or a comma-separated string. Example: ["31452104", "31452105"].
dbfromYesSource database holding the input UIDs, for example "pubmed".
historyNoPointer to a UID set stored on the NCBI History server. Pass back the object returned by a previous call, unchanged.
linknameNoSpecific link to follow, for example "pubmed_pmc". Call eutils_einfo to list valid link names.
response_formatNoOutput format: 'markdown' for human-readable text, or 'json' for machine-readable data. Default: 'markdown'.markdown

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
dbtoNo
dbfromYes
groupsYes
commandYes
historiesNoPresent when cmd is neighbor_history.
groups_foundYes
total_linkedYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already declare readOnly/openWorld/non-idempotent/non-destructive, so the description's added value is the History-server persistence semantics of cmd="neighbor_history" (a real side effect explaining the non-idempotent hint), the uids-vs-history mutual exclusion rule, and error-handling behavior (rejecting a mismatched history db, empty-result hint). It stops short of covering operational concerns like rate limits or expired-history handling, but the additions are substantive rather than restated annotation content.

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?

Well front-loaded: purpose first, then the database-bridging framing, then a structured Args/Returns/Examples/Error Handling layout. It is slightly long because the Args section and Returns block duplicate the input and output schemas, but every non-duplicated sentence earns its place.

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?

For a 7-parameter tool with nested objects and cross-database semantics, the definition covers selection, chaining, constraints, and failure modes; the returns description is redundant given an output schema exists but does no harm. An agent has everything needed to call it correctly.

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 already 100%, so the Args section largely restates the schema. However, it adds meaning the schema does not encode: "Supply either uids or history, never both" and the note that history.db must match dbfrom, plus the shorthand that omit-db means same-database links.

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 (find records linked to a set of UIDs) and immediately scopes it as cross-database navigation with concrete examples (gene to protein, pubmed to pmc). It explicitly differentiates itself from siblings by naming eutils_link_then_fetch as the alternative when records are wanted rather than UID lists.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Contains an explicit "Use when" list with three concrete scenarios and a "Don't use when" clause that routes to eutils_link_then_fetch. It also names eutils_einfo for discovering link names and describes the chaining path into eutils_efetch.

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