Skip to main content
Glama

get_citations

Retrieve a formatted citation for a given PubMed ID (PMID) in AMA, APA, or Vancouver style.

Instructions

Return a formatted citation for a PMID. Styles: AMA, APA, Vancouver.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pmidYes
styleNoAMA

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • server.py:44-57 (handler)
    The get_citations tool handler. Accepts a PMID and citation style (default 'AMA'), fetches article summary from PubMed eutils, formats authors/title/journal/year/volume/pages into a citation string.
    async def get_citations(pmid: str, style: str = "AMA") -> str:
        """Return a formatted citation for a PMID. Styles: AMA, APA, Vancouver."""
        async with httpx.AsyncClient() as client:
            r = await client.get(f"{PUBMED_BASE}/esummary.fcgi", params={
                "db": "pubmed", "id": pmid, "retmode": "json"
            })
            s = r.json()["result"][pmid]
            authors = ", ".join([a["name"] for a in s.get("authors", [])[:3]])
            title = s["title"]
            journal = s["fulljournalname"]
            year = s["pubdate"][:4]
            volume = s.get("volume", "")
            pages = s.get("pages", "")
            return f"{authors}. {title} {journal}. {year};{volume}:{pages}. PMID: {pmid}"
  • server.py:43-43 (registration)
    The @mcp.tool() decorator registers get_citations as an MCP tool. This is a single-file codebase using FastMCP, so registration is done inline via the decorator.
    @mcp.tool()
  • Input schema defined by the function signature: pmid (required str) and style (optional str, default 'AMA').
    async def get_citations(pmid: str, style: str = "AMA") -> str:
Behavior2/5

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

No annotations provided. Description only mentions a safe read operation but lacks details on error handling, input validation, or rate limits.

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

Conciseness5/5

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

Single sentence, no redundancy. Front-loaded with the essential action and examples.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Adequate for a simple 2-parameter tool with an output schema, but lacks error handling context and usage differentiation from siblings.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Description adds meaning to the style parameter by listing examples (AMA, APA, Vancouver), but pmid parameter is not explained beyond its name. Schema coverage is 0%, so description partially compensates.

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?

Clearly states it returns a formatted citation for a PMID, listing specific styles. Distinct from sibling tools like get_abstract or search_pubmed.

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

Usage Guidelines3/5

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

Implied usage for citation formatting, but no explicit guidance on when to use versus alternatives like get_abstract for abstracts.

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

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/pubspro/pubmed-search'

If you have feedback or need assistance with the MCP directory API, please join our Discord server