generate_search_queries
Generates search intelligence for PubMed topics by extracting keywords, MeSH terms, and synonyms. Corrects spelling, suggests queries with estimated results, and shows how PubMed interprets the query.
Instructions
Gather search intelligence for a topic - returns RAW MATERIALS for Agent to decide.
This tool provides the BUILDING BLOCKS for search, not finished queries. The Agent decides how to use them.
══════════════════════════════════════════════════════════════════════ TWO USAGE MODES: ══════════════════════════════════════════════════════════════════════
MODE 1: KEYWORD SEARCH (single topic) ───────────────────────────────────── User: "搜尋 remimazolam 的文獻"
Step 1: generate_search_queries("remimazolam") Step 2: Build a Boolean query from returned materials Step 3: analyze_search_query(query="") Step 4: unified_search(query="")
══════════════════════════════════════════════════════════════════════
MODE 2: PICO SEARCH (clinical question) ─────────────────────────────────────── User: "remimazolam 在 ICU 鎮靜比 propofol 好嗎?會減少 delirium 嗎?"
Step 1: Agent extracts P/I/C/O from the clinical question, then calls parse_pico(description=..., p=..., i=..., c=..., o=...) to validate the structured handoff and get a runnable PICO pipeline.
Step 2: For EACH PICO element, call generate_search_queries() IN PARALLEL: - generate_search_queries("ICU patients") → P materials - generate_search_queries("remimazolam") → I materials - generate_search_queries("propofol") → C materials - generate_search_queries("delirium") → O materials
Step 3: Combine materials using Boolean logic: High precision: (P_terms) AND (I_terms) AND (C_terms) AND (O_terms) High recall: (P_terms) AND (I_terms OR C_terms) AND (O_terms)
Step 4: Add Clinical Query filter if appropriate: - therapy[filter] → 治療效果比較 - diagnosis[filter] → 診斷相關 - prognosis[filter] → 預後相關 - etiology[filter] → 病因相關
Step 5: Validate the final query with analyze_search_query()
Step 6: Execute unified_search() with the final Boolean query══════════════════════════════════════════════════════════════════════
Features:
Spelling correction via NCBI ESpell
MeSH term lookup for standardized vocabulary
Synonym expansion from MeSH database
Query analysis: Shows how PubMed actually interprets each query (Agent's understanding vs PubMed's actual interpretation)
Args: topic: Search topic - can be a single keyword or PICO element strategy: Affects suggested_queries (if included) - "comprehensive": Multiple angles, includes reviews (default) - "focused": Adds RCT filter for high evidence - "exploratory": Broader search with more synonyms check_spelling: Whether to check/correct spelling (default: True) include_suggestions: Include pre-built query suggestions (default: True)
Returns: JSON with RAW MATERIALS: - corrected_topic: Spell-checked topic - keywords: Extracted significant keywords - mesh_terms: MeSH data with preferred terms and synonyms - all_synonyms: Flattened list of all synonyms - suggested_queries: Optional pre-built queries with: - estimated_count: How many results PubMed would return - pubmed_translation: How PubMed actually interprets the query
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| topic | Yes | ||
| strategy | No | comprehensive | |
| check_spelling | No | ||
| include_suggestions | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |