Skip to main content
Glama

get_trending_articles

Retrieve recently published or trending articles in a specific biomedical field. Set the lookback period and maximum results as needed.

Instructions

Get recently published or trending articles in a specific field

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fieldYesResearch field or topic
daysNoNumber of days to look back (default: 30)
max_resultsNoMaximum results (default: 20)

Implementation Reference

  • The handler function that executes the 'get_trending_articles' tool logic. It accepts 'field', 'days', and 'max_results' parameters, searches PubMed via eutilsClient with a date range, and returns matching article PMIDs.
    async function handleGetTrendingArticles(args: any) {
      const { field, days = 30, max_results = 20 } = args;
    
      const endDate = new Date();
      const startDate = new Date();
      startDate.setDate(startDate.getDate() - days);
    
      const searchResult = await eutilsClient.search({
        term: field,
        retmax: max_results,
        mindate: formatDateForAPI(startDate),
        maxdate: formatDateForAPI(endDate),
        sort: 'pub+date'
      });
    
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify({
              field,
              days,
              dateRange: {
                from: formatDateForAPI(startDate),
                to: formatDateForAPI(endDate)
              },
              totalResults: searchResult.count,
              pmids: searchResult.pmids
            }, null, 2)
          }
        ]
      };
  • src/index.ts:226-251 (registration)
    Where the 'get_trending_articles' tool is registered with its name, description, and input schema. It defines required 'field' param and optional 'days' and 'max_results' params.
    {
      name: 'get_trending_articles',
      description: 'Get recently published or trending articles in a specific field',
      inputSchema: {
        type: 'object',
        properties: {
          field: {
            type: 'string',
            description: 'Research field or topic'
          },
          days: {
            type: 'number',
            description: 'Number of days to look back (default: 30)',
            minimum: 1,
            maximum: 365
          },
          max_results: {
            type: 'number',
            description: 'Maximum results (default: 20)',
            minimum: 1,
            maximum: 100
          }
        },
        required: ['field']
      }
    },
  • The inputSchema for 'get_trending_articles' defines validation for field (required string), days (optional number 1-365), and max_results (optional number 1-100).
    inputSchema: {
      type: 'object',
      properties: {
        field: {
          type: 'string',
          description: 'Research field or topic'
        },
        days: {
          type: 'number',
          description: 'Number of days to look back (default: 30)',
          minimum: 1,
          maximum: 365
        },
        max_results: {
          type: 'number',
          description: 'Maximum results (default: 20)',
          minimum: 1,
          maximum: 100
        }
      },
      required: ['field']
    }
Behavior2/5

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

With no annotations, the description must disclose behavioral traits. It fails to explain what 'trending' means algorithmically, whether results are sorted, or any potential side effects. The description is too terse to be behaviorally transparent.

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, front-loaded sentence with no wasted words. Every part contributes to understanding the tool's core purpose.

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 the tool's simplicity (3 params, no output schema), the description covers the basic purpose but omits details like sorting order, interpretation of 'trending', and any default behavior. Adequate but not fully complete.

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 coverage is 100%, so the schema already documents all parameters (field, days, max_results). The description adds no extra meaning beyond the schema; it only echoes 'field'. Baseline 3 is appropriate.

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 tool retrieves 'recently published or trending articles in a specific field'. It uses a specific verb ('get') and resource ('articles') and differentiates from siblings like 'search_articles' which is broader, by focusing on recency/trending.

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 for finding recent/trending articles but does not explicitly state when to use this tool versus alternatives (e.g., 'search_articles' for general queries). No explicit when-not-to-use guidance is provided.

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/Augmented-Nature/PubMed-MCP-Server'

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