Skip to main content
Glama

get_article

Retrieve complete metadata for PubMed articles using PMID, including title, abstract, authors, journal details, publication date, DOI, and MeSH terms.

Instructions

Get full metadata for a specific PubMed article by PMID, including title, abstract, authors, journal, publication date, DOI, and MeSH terms.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pmidYesPubMed ID

Implementation Reference

  • Main handler function getArticle that executes the tool logic - fetches article XML from NCBI client, parses it using parseArticles utility, and returns the first article as JSON or an error message if not found.
    export async function getArticle(args: z.infer<typeof getArticleSchema>): Promise<string> {
      const xml = await client.efetch([args.pmid]);
      const articles = parseArticles(xml);
      if (articles.length === 0) {
        return JSON.stringify({ error: `No article found for PMID ${args.pmid}` });
      }
      return JSON.stringify(articles[0], null, 2);
    }
  • Zod schema definition for getArticleSchema - validates input requiring a pmid (PubMed ID) string parameter.
    export const getArticleSchema = z.object({
      pmid: z.string().describe("PubMed ID"),
    });
  • src/index.ts:34-41 (registration)
    MCP server tool registration for 'get_article' - registers the tool with its name, description, schema shape, and async handler that parses arguments and calls getArticle function.
    server.tool(
      "get_article",
      "Get full metadata for a specific PubMed article by PMID, including title, abstract, authors, journal, publication date, DOI, and MeSH terms.",
      getArticleSchema.shape,
      async (args) => ({
        content: [{ type: "text", text: await getArticle(getArticleSchema.parse(args)) }],
      })
    );
Behavior3/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. It describes the output content but doesn't disclose behavioral traits like rate limits, authentication needs, error handling, or whether it's a read-only operation (implied by 'Get' but not explicit). It adds value by detailing the metadata fields but lacks operational context.

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 a single, efficient sentence that front-loads the core purpose ('Get full metadata for a specific PubMed article by PMID') and lists the included data without unnecessary words. Every part earns its place by clarifying scope and content.

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

Completeness4/5

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

Given the tool's low complexity (single parameter, no output schema, no annotations), the description is complete enough for basic use: it specifies the action, input requirement, and output details. However, it could improve by mentioning the absence of behavioral annotations or output schema, but it adequately covers the core functionality.

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%, with the parameter 'pmid' clearly documented as 'PubMed ID'. The description adds no additional parameter semantics beyond what the schema provides, such as format examples or constraints, so it meets the baseline for high schema coverage without compensating further.

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 verb 'Get' and resource 'full metadata for a specific PubMed article by PMID', specifying the exact data returned (title, abstract, authors, journal, publication date, DOI, MeSH terms). It distinguishes from siblings like 'search_articles' (search vs. specific retrieval) and 'get_citations' (citations vs. metadata).

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 implies usage context by specifying 'by PMID' and listing the metadata returned, suggesting it's for retrieving complete article details when the PMID is known. However, it doesn't explicitly state when not to use it (e.g., vs. 'search_articles' for unknown IDs or 'get_citations' for citation data), though the specificity helps differentiate.

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