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

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",
        )

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