Skip to main content
Glama

get_full_text_links

Retrieve free full-text article links from PubMed Central and publisher sources using a PubMed ID to access biomedical research.

Instructions

Get links to free full text versions of an article (e.g., PubMed Central). Returns PMC links and publisher free-access URLs.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pmidYesPubMed ID to find full text links for

Implementation Reference

  • The getFullTextLinks handler function that retrieves full text links for a PubMed article by calling NCBI's elink API. It fetches both PMC (PubMed Central) links and provider links, returning a JSON response with the PMID, full_text_links array, and a boolean indicating if free full text is available.
    export async function getFullTextLinks(args: z.infer<typeof getFullTextLinksSchema>): Promise<string> {
      // Use elink to find PMC links and provider links
      const result = await client.elinkCmd([args.pmid], "llinks", "pubmed") as {
        linksets?: Array<{
          idurllist?: Array<{
            objurls?: Array<{
              url?: { value?: string };
              linkname?: string;
              provider?: { name?: string[] };
              categories?: Array<{ category?: string }>;
            }>;
          }>;
        }>;
      };
    
      // Also check for PMC link
      const pmcResult = await client.elink([args.pmid], "pubmed_pmc", "pubmed", "pmc") as {
        linksets?: Array<{ linksetdbs?: Array<{ links?: string[] }> }>;
      };
    
      const pmcIds = pmcResult.linksets?.[0]?.linksetdbs?.[0]?.links || [];
      const links: Array<Record<string, string>> = [];
    
      if (pmcIds.length > 0) {
        links.push({
          source: "PubMed Central",
          url: `https://www.ncbi.nlm.nih.gov/pmc/articles/PMC${pmcIds[0]}/`,
          pmcid: `PMC${pmcIds[0]}`,
        });
      }
    
      // Extract provider links
      const urlList = result.linksets?.[0]?.idurllist?.[0]?.objurls || [];
      for (const obj of urlList) {
        const url = obj.url?.value;
        if (url) {
          links.push({
            source: obj.provider?.name?.[0] || obj.linkname || "Unknown",
            url,
          });
        }
      }
    
      return JSON.stringify({
        pmid: args.pmid,
        full_text_links: links,
        has_free_full_text: links.length > 0,
      }, null, 2);
    }
  • The Zod schema definition for getFullTextLinks that validates the input parameters. It requires a single parameter: pmid (PubMed ID as a string).
    export const getFullTextLinksSchema = z.object({
      pmid: z.string().describe("PubMed ID to find full text links for"),
    });
  • src/index.ts:70-77 (registration)
    Tool registration that registers get_full_text_links with the MCP server. It includes the tool name, description, schema shape, and the handler that calls getFullTextLinks with parsed arguments.
    server.tool(
      "get_full_text_links",
      "Get links to free full text versions of an article (e.g., PubMed Central). Returns PMC links and publisher free-access URLs.",
      getFullTextLinksSchema.shape,
      async (args) => ({
        content: [{ type: "text", text: await getFullTextLinks(getFullTextLinksSchema.parse(args)) }],
      })
    );
Behavior3/5

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

With no annotations provided, the description carries full burden. It discloses the return types ('PMC links and publisher free-access URLs') and implies a read-only operation, but lacks details on rate limits, authentication needs, error conditions, or response format. It adds some behavioral context but leaves gaps for a tool with potential external API calls.

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?

Two concise sentences with zero waste: the first states purpose and examples, the second specifies return values. It is front-loaded with the core functionality and appropriately sized for a single-parameter tool.

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?

Given no annotations and no output schema, the description provides adequate purpose and return type information but lacks details on behavioral traits (e.g., network dependencies, error handling) and output structure. For a tool that likely interacts with external services, this leaves room for improvement in completeness.

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 'pmid' parameter fully. The description adds no additional parameter semantics beyond what the schema provides (e.g., format examples, validation rules). Baseline 3 is appropriate when schema does the heavy lifting.

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 verb ('Get links to') and resource ('free full text versions of an article'), with concrete examples ('PubMed Central'). It distinguishes from siblings by focusing on link retrieval rather than article metadata (get_article), citations (get_citations), or searches (search_articles/search_mesh).

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?

The description implies usage when full-text links are needed for a PubMed article, but provides no explicit guidance on when to choose this tool over alternatives like get_article (which might include links) or when not to use it (e.g., for non-PubMed IDs). The context is clear but lacks sibling differentiation or exclusion criteria.

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