Skip to main content
Glama
fegizii

Semantic Scholar MCP Server

by fegizii

get_author

Retrieve detailed academic author information from Semantic Scholar by providing an author ID and optional field specifications.

Instructions

Get detailed information about a specific author.

Args:
    author_id: Author ID
    fields: Comma-separated list of fields to return

Returns:
    Detailed author information

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
author_idYes
fieldsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The handler function for the get_author tool. It is decorated with @mcp.tool() which handles both implementation and registration in FastMCP. Retrieves author details via Semantic Scholar API and formats output including recent papers.
    @mcp.tool()
    async def get_author(author_id: str, fields: Optional[str] = None) -> str:
        """
        Get detailed information about a specific author.
    
        Args:
            author_id: Author ID
            fields: Comma-separated list of fields to return
    
        Returns:
            Detailed author information
        """
        params = {}
        if fields:
            params["fields"] = fields
        else:
            params["fields"] = "authorId,name,paperCount,citationCount,hIndex,papers"
    
        result = await make_api_request(f"author/{author_id}", params)
    
        if result is None:
            return "Error: Failed to fetch author"
    
        if "error" in result:
            return f"Error: {result['error']}"
    
        author = result
        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)
    
        papers = author.get("papers", [])
    
        result_text = f"""Name: {name}
    Author ID: {author_id}
    Total Papers: {paper_count}
    Total Citations: {citation_count}
    H-Index: {h_index}
    
    Recent Papers ({len(papers)} shown):"""
    
        if papers:
            for i, paper in enumerate(papers[:10], 1):
                title = paper.get("title", "Unknown Title")
                year = paper.get("year", "Unknown")
                citations = paper.get("citationCount", 0)
                result_text += f"\n{i}. {title} ({year}) - {citations} citations"
    
        return result_text
  • Helper function used in author-related tools to format author information for display.
    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}"
  • General helper function used by get_author to make API requests to Semantic Scholar, handling errors and authentication.
    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 full burden for behavioral disclosure. It states this is a 'Get' operation which implies read-only, but doesn't specify authentication requirements, rate limits, error conditions, or what happens with invalid author_id. The description mentions 'detailed information' but doesn't characterize what level of detail or typical response structure beyond what the output schema provides.

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 appropriately concise with a clear purpose statement followed by structured Args and Returns sections. Each sentence earns its place by providing essential information. The structure helps with readability, though the 'Returns' section is somewhat redundant given the existence of an output schema.

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 (2 parameters, 1 required), no annotations, but with an output schema, the description is minimally adequate. The output schema means the description doesn't need to explain return values, but it should provide more context about usage scenarios, error handling, and parameter details given the 0% schema description coverage.

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 0%, so the schema provides no parameter descriptions. The description adds basic semantics: author_id identifies 'a specific author' and fields is a 'comma-separated list of fields to return'. However, it doesn't explain what fields are available, format examples, or what happens when fields is null. This provides some value but leaves significant gaps in parameter understanding.

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 with 'Get detailed information about a specific author' - a specific verb (Get) and resource (author). It distinguishes from siblings like search_authors (which searches multiple authors) by focusing on a single specific author. However, it doesn't explicitly contrast with get_paper which might also return author information.

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. It doesn't mention when to use get_author versus search_authors (for finding authors) or get_paper (which might include author details). There's no context about prerequisites, limitations, or typical use cases for this specific retrieval operation.

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