Skip to main content
Glama

search_by_author

Find PubMed articles by a specific author, filter by publication years, and retrieve recent publications.

Instructions

Search PubMed for all articles by a specific author.

Args: author: Author name in PubMed format. Examples: "Smith JA" (last name + initials — most precise) "Smith J" (last name + first initial) "John Smith" (full name, less reliable) max_results: Number of results to return (1-100, default 10). year_from: Restrict to articles published from this year. year_to: Restrict to articles published up to this year.

Returns: A list of articles by the author, sorted by most recent first. Returns an error message if the author name is empty or the query fails.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
authorYes
max_resultsNo
year_fromNo
year_toNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • main.py:619-650 (handler)
    The `search_by_author` function is defined as an MCP tool, which validates input and calls the `search_pubmed` helper function.
    @mcp.tool()
    async def search_by_author(
        author: str,
        max_results: int = 10,
        year_from: Optional[int] = None,
        year_to: Optional[int] = None,
    ) -> str:
        """Search PubMed for all articles by a specific author.
    
        Args:
            author: Author name in PubMed format. Examples:
                    "Smith JA"   (last name + initials — most precise)
                    "Smith J"    (last name + first initial)
                    "John Smith" (full name, less reliable)
            max_results: Number of results to return (1-100, default 10).
            year_from: Restrict to articles published from this year.
            year_to:   Restrict to articles published up to this year.
    
        Returns:
            A list of articles by the author, sorted by most recent first.
            Returns an error message if the author name is empty or the query fails.
        """
        if not author or not author.strip():
            return _err("Author name must not be empty.")
    
        return await search_pubmed(
            query=f"{author.strip()}[author]",
            max_results=max_results,
            year_from=year_from,
            year_to=year_to,
            sort="date",
        )
Behavior4/5

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

With no annotations provided, the description carries the full burden. It successfully discloses sorting behavior ('sorted by most recent first') and error conditions ('Returns an error message if the author name is empty'). Lacks only details on pagination or rate limiting.

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?

Efficiently structured with clear Args/Returns sections. Every element serves a purpose: examples clarify PubMed naming conventions, ranges prevent invalid inputs, and the Returns section sets expectations. No redundant or filler text.

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

Completeness5/5

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

Comprehensive for a 4-parameter search tool. Despite existing output schema (not shown), the description adds essential behavioral context (sorting order, error formats) that schemas typically don't convey. Fully covers all parameters given the zero schema coverage.

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

Parameters5/5

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

Excellent compensation for 0% schema coverage. The Args section provides detailed semantics: three concrete format examples for 'author' (Smith JA, Smith J, John Smith), valid range for 'max_results' (1-100, default 10), and clear temporal semantics for year filters ('from this year', 'up to this year').

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?

Opens with specific verb+resource: 'Search PubMed for all articles by a specific author.' The phrase 'by a specific author' clearly distinguishes this from the sibling tool 'search_pubmed' (general search) and positions it as the correct choice for author-specific queries.

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?

Provides clear context through the specificity of 'by a specific author,' implying the exact use case (author-based retrieval). However, it lacks explicit 'when not to use' guidance or explicit comparison to 'search_pubmed' for broader queries.

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

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