Skip to main content
Glama
fegizii

Semantic Scholar MCP Server

by fegizii

search_authors

Find academic authors by name using the Semantic Scholar database to retrieve publication and citation information.

Instructions

Search for authors by name.

Args:
    query: Author name or search query
    limit: Maximum number of results (default: 10, max: 1000)
    offset: Number of results to skip (default: 0)
    fields: Comma-separated list of fields to return

Returns:
    Formatted author search results

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes
limitNo
offsetNo
fieldsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The core handler function for the 'search_authors' tool. It is decorated with @mcp.tool(), which registers it with the MCP server and generates schema from the signature and docstring. Performs API search for authors, formats results using format_author helper, and returns a formatted string of results.
    @mcp.tool()
    async def search_authors(
        query: str, limit: int = 10, offset: int = 0, fields: Optional[str] = None
    ) -> str:
        """
        Search for authors by name.
    
        Args:
            query: Author name or search query
            limit: Maximum number of results (default: 10, max: 1000)
            offset: Number of results to skip (default: 0)
            fields: Comma-separated list of fields to return
    
        Returns:
            Formatted author search results
        """
        params = {"query": query, "limit": min(limit, 1000), "offset": offset}
    
        if fields:
            params["fields"] = fields
        else:
            params["fields"] = "authorId,name,paperCount,citationCount,hIndex"
    
        result = await make_api_request("author/search", params)
    
        if result is None:
            return "Error: Failed to fetch authors"
    
        if "error" in result:
            return f"Error: {result['error']}"
    
        authors = result.get("data", [])
        total = result.get("total", 0)
    
        if not authors:
            return "No authors found matching your query."
    
        formatted_authors = []
        for i, author in enumerate(authors, 1):
            formatted_authors.append(f"{i}. {format_author(author)}")
    
        result_text = f"Found {total} total authors (showing {len(authors)}):\n\n"
        result_text += "\n\n".join(formatted_authors)
    
        return result_text
  • Helper function used by search_authors to format individual author data into a readable string.
    def format_author(author: Dict[str, Any]) -> str:
        """Format an author for display."""
        name = author.get("name", "Unknown Name")
        author_id = author.get("authorId", "")
        paper_count = author.get("paperCount", 0)
        citation_count = author.get("citationCount", 0)
        h_index = author.get("hIndex", 0)
    
        return f"Name: {name}\nAuthor ID: {author_id}\nPapers: {paper_count}\nCitations: {citation_count}\nH-Index: {h_index}"
  • Shared helper function that makes HTTP requests to the Semantic Scholar API, handles errors, and is called by search_authors to fetch author search results.
    async def make_api_request(
        endpoint: str, params: Optional[Dict[str, Any]] = None, method: str = "GET"
    ) -> Optional[Dict[str, Any]]:
        """Make a request to the Semantic Scholar API."""
        url = f"{BASE_URL}/{endpoint.lstrip('/')}"
    
        headers = {
            "Accept": "application/json",
            "User-Agent": f"semantic-scholar-mcp/{USER_AGENT_VERSION}",
        }
    
        if API_KEY:
            headers["x-api-key"] = API_KEY
    
        try:
            async with httpx.AsyncClient(timeout=API_TIMEOUT) as client:
                if method == "GET":
                    response = await client.get(url, headers=headers, params=params)
                elif method == "POST":
                    response = await client.post(url, headers=headers, json=params)
                else:
                    raise ValueError(f"Unsupported HTTP method: {method}")
    
                response.raise_for_status()
                return response.json()
    
        except httpx.HTTPStatusError as e:
            if e.response.status_code == 403:
                if not API_KEY:
                    return {
                        "error": "Rate limit exceeded. The shared public rate limit (1000 req/sec) may be exceeded. Get a free API key from https://www.semanticscholar.org/product/api for dedicated limits."
                    }
                else:
                    return {
                        "error": f"API key may be invalid or rate limit exceeded: {str(e)}"
                    }
            elif e.response.status_code == 429:
                return {
                    "error": "Rate limit exceeded. Please wait a moment and try again, or get an API key for dedicated higher limits."
                }
            else:
                return {"error": f"HTTP error: {str(e)}"}
        except httpx.HTTPError as e:
            return {"error": f"HTTP error: {str(e)}"}
        except Exception as e:
            return {"error": f"Request failed: {str(e)}"}
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions that the tool 'returns formatted author search results,' which hints at a read-only operation, but doesn't clarify aspects like authentication needs, rate limits, pagination behavior beyond offset/limit, or error handling. For a search tool with zero annotation coverage, this leaves significant gaps in understanding its operational traits.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with a clear purpose statement followed by parameter and return value sections. It's appropriately sized with no redundant information, though the 'Returns' section could be more specific given the output schema exists, making it slightly less efficient than ideal.

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 moderate complexity (4 parameters, 1 required), no annotations, and an output schema present, the description is adequate but has gaps. It covers parameter semantics well but lacks usage guidelines and detailed behavioral context. The output schema reduces the need to explain return values, but overall completeness is limited by missing operational guidance.

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

Parameters4/5

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

The description adds meaningful context beyond the input schema, which has 0% description coverage. It explains that 'query' is for 'author name or search query,' specifies default and max values for 'limit,' defines 'offset' as 'number of results to skip,' and describes 'fields' as a 'comma-separated list of fields to return.' This compensates well for the schema's lack of descriptions, though it doesn't detail what fields are available or query syntax nuances.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose as 'Search for authors by name,' which is a specific verb+resource combination. However, it doesn't explicitly differentiate from sibling tools like 'get_author' or 'search_papers,' which would require more specific context about when to use each.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'get_author' (for specific authors) or 'search_papers' (for paper-based searches). There's no mention of prerequisites, typical use cases, or exclusions, leaving the agent to infer usage from the tool name alone.

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/fegizii/SemanticScholarMCP'

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