Skip to main content
Glama

get_citations

Find articles that cite a specific PubMed publication to track forward citations and discover related research.

Instructions

Get articles that cite a given PubMed article (PMID). Useful for forward citation tracking.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pmidYesPubMed ID to find citing articles for

Implementation Reference

  • The getCitations function that executes the tool logic. It queries NCBI's elink API to find articles that cite a given PMID, fetches article details for up to 20 citing articles, and returns a JSON response with the citing count and article summaries.
    export async function getCitations(args: z.infer<typeof getCitationsSchema>): Promise<string> {
      const result = await client.elink([args.pmid], "pubmed_pubmed_citedin") as {
        linksets?: Array<{ linksetdbs?: Array<{ links?: string[] }> }>;
      };
    
      const links = result.linksets?.[0]?.linksetdbs?.[0]?.links || [];
    
      if (links.length === 0) {
        return JSON.stringify({ pmid: args.pmid, citing_count: 0, citing_articles: [] }, null, 2);
      }
    
      // Fetch summaries for citing articles (max 20)
      const fetchIds = links.slice(0, 20);
      const xml = await client.efetch(fetchIds);
      const articles = parseArticles(xml);
    
      return JSON.stringify({
        pmid: args.pmid,
        citing_count: links.length,
        showing: articles.length,
        citing_articles: articles.map(formatArticleSummary),
      }, null, 2);
    }
  • The getCitationsSchema defines input validation for the tool, accepting a single 'pmid' string parameter (PubMed ID to find citing articles for).
    export const getCitationsSchema = z.object({
      pmid: z.string().describe("PubMed ID to find citing articles for"),
    });
  • src/index.ts:43-50 (registration)
    The get_citations tool is registered with the MCP server, mapping the schema shape to the getCitations handler function with a description explaining its forward citation tracking purpose.
    server.tool(
      "get_citations",
      "Get articles that cite a given PubMed article (PMID). Useful for forward citation tracking.",
      getCitationsSchema.shape,
      async (args) => ({
        content: [{ type: "text", text: await getCitations(getCitationsSchema.parse(args)) }],
      })
    );
  • The formatArticleSummary helper function used by getCitations to format article metadata (PMID, title, authors, journal, publication date, DOI, and abstract) into a concise summary object.
    function formatArticleSummary(a: ArticleMetadata) {
      return {
        pmid: a.pmid,
        title: a.title,
        authors: a.authors.slice(0, 5).join(", ") + (a.authors.length > 5 ? " et al." : ""),
        journal: a.journal,
        pub_date: a.pubDate,
        doi: a.doi || undefined,
        abstract: a.abstract.length > 500 ? a.abstract.slice(0, 500) + "..." : a.abstract,
      };
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions the purpose but lacks details on permissions, rate limits, response format, or error handling. This is inadequate for a tool with no annotation coverage.

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?

The description is appropriately sized with two concise sentences, front-loaded with the main purpose and followed by usage context, with zero wasted words or redundancy.

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

Completeness2/5

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

Given no annotations and no output schema, the description is incomplete. It lacks details on behavioral traits, return values, and error handling, which are essential for a tool with no structured data to compensate.

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?

Schema description coverage is 100%, so the schema already documents the single parameter (pmid). The description adds minimal context by implying the parameter is for 'a given PubMed article', but does not provide additional syntax or format details beyond what the schema provides.

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?

The description clearly states the specific action ('Get articles that cite') and resource ('a given PubMed article (PMID)'), and distinguishes this tool from siblings by specifying forward citation tracking, which is not covered by other tools like get_article or search_articles.

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

Usage Guidelines4/5

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

The description provides clear context for when to use this tool ('Useful for forward citation tracking'), but does not explicitly state when not to use it or name alternatives among siblings, such as get_related for other types of article relationships.

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

Install Server

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/PetrefiedThunder/mcp-pubmed'

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