get_abstract
Retrieve the full abstract of a PubMed article using its PMID.
Instructions
Retrieve full abstract for a given PubMed ID (PMID).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pmid | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- server.py:28-35 (handler)The get_abstract async function that fetches a PubMed abstract by PMID via the NCBI efetch API and returns the raw text.
@mcp.tool() async def get_abstract(pmid: str) -> str: """Retrieve full abstract for a given PubMed ID (PMID).""" async with httpx.AsyncClient() as client: r = await client.get(f"{PUBMED_BASE}/efetch.fcgi", params={ "db": "pubmed", "id": pmid, "rettype": "abstract", "retmode": "text" }) return r.text - server.py:28-28 (registration)The tool is registered via the @mcp.tool() decorator on the get_abstract function.
@mcp.tool()