build_citation_tree
Build a citation network from a PubMed article to map forward and backward research links, with output in multiple graph formats for analysis.
Instructions
Build a citation tree (network) from a single article.
🌳 Creates a visual citation network showing research lineage:
Forward (citing): Who cites this paper? (newer research)
Backward (references): What does this paper cite? (foundational work)
⚠️ IMPORTANT: Only accepts ONE PMID at a time to control API load. For multiple papers, call this tool separately for each.
📊 Output Formats (output_format parameter):
"cytoscape": Cytoscape.js format (default, academic standard)
"g6": AntV G6 format (modern, high-performance)
"d3": D3.js force graph format (flexible, Observable)
"vis": vis-network format (simple, quick prototypes)
"graphml": GraphML XML (desktop tools: Gephi, yEd, VOSviewer)
"mermaid": Mermaid diagram (VS Code preview, Markdown) ⭐NEW
Args: pmid: Single PubMed ID (e.g., "12345678"). Only ONE PMID accepted - do NOT pass multiple. depth: How many levels to traverse (1-3, default 2). - depth=1: Direct citations/references only - depth=2: Also get citations of citations (recommended) - depth=3: Maximum depth (can be slow, ~100+ API calls) direction: Which direction to build the tree: - "forward": Only citing articles (who cites this) - "backward": Only references (what this cites) - "both": Both directions (default, recommended) limit_per_level: Max articles to fetch per node per level (default 5) include_details: Include full article details (default True) output_format: Graph format for visualization (default "cytoscape") - "cytoscape": Cytoscape.js (academic standard, bioinformatics) - "g6": AntV G6 (modern, TypeScript, great for large graphs) - "d3": D3.js force layout (most flexible, Observable notebooks) - "vis": vis-network (simple and easy) - "graphml": GraphML XML (Gephi, VOSviewer, yEd, Pajek) - "mermaid": Mermaid diagram (preview in VS Code Markdown)
Returns: JSON string with graph data in the requested format. Includes metadata and statistics regardless of format.
Example usage: # Build 2-level tree for a paper (default Cytoscape.js format) build_citation_tree(pmid="33475315", depth=2, direction="both")
# Use AntV G6 format for modern web visualization
build_citation_tree(pmid="33475315", depth=2, output_format="g6")
# Export GraphML for Gephi analysis
build_citation_tree(pmid="33475315", depth=2, output_format="graphml")
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pmid | Yes | ||
| depth | No | ||
| direction | No | both | |
| limit_per_level | No | ||
| include_details | No | ||
| output_format | No | cytoscape |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |