get_author_papers
Retrieve all published papers by a specific author from NASA ADS, including citations and publication details. Sort results by date or citation count to analyze research output.
Instructions
Find all papers by a specific author. Returns list of papers with citations and publication details.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| author | Yes | Author name (e.g., 'Coelho, P.' or 'Coelho, Paula') | |
| max_results | No | Maximum number of results (default: 20, max: 100) | |
| sort | No | Sort by 'date' or 'citation_count' | date |
Implementation Reference
- src/nasa_ads_mcp/server.py:417-461 (handler)The main handler function that executes the tool logic: queries the NASA ADS API for papers by the given author, formats the results with titles, years, citations, and bibcodes, and returns them as TextContent.async def get_author_papers(author: str, max_results: int, sort: str) -> list[TextContent]: """Get papers by a specific author.""" try: # Prepare sort parameter sort_param = "date desc" if sort == "date" else "citation_count desc" # Search for author papers = ads.SearchQuery( author=author, fl=["bibcode", "title", "year", "citation_count", "pubdate"], rows=min(max_results, 100), sort=sort_param, ) # Format results results = [] total_citations = 0 for i, paper in enumerate(papers, 1): citations = paper.citation_count or 0 total_citations += citations results.append( f"{i}. {paper.title[0] if paper.title else 'No title'} ({paper.year})\n" f" Citations: {citations} | Bibcode: {paper.bibcode}\n" ) if not results: return [TextContent( type="text", text=f"No papers found for author: {author}" )] response = ( f"Found {len(results)} papers by '{author}' " f"(Total citations: {total_citations}):\n\n" + "\n".join(results) ) return [TextContent(type="text", text=response)] except Exception as e: logger.error(f"Error getting author papers: {e}") return [TextContent( type="text", text=f"Error getting author papers: {str(e)}" )]
- src/nasa_ads_mcp/server.py:101-121 (schema)Pydantic/JSON schema defining the input parameters for the get_author_papers tool: author (required), max_results (default 20), sort (date or citation_count, default date). Defines validation and documentation.inputSchema={ "type": "object", "properties": { "author": { "type": "string", "description": "Author name (e.g., 'Coelho, P.' or 'Coelho, Paula')", }, "max_results": { "type": "integer", "description": "Maximum number of results (default: 20, max: 100)", "default": 20, }, "sort": { "type": "string", "description": "Sort by 'date' or 'citation_count'", "enum": ["date", "citation_count"], "default": "date", }, }, "required": ["author"], },
- src/nasa_ads_mcp/server.py:95-122 (registration)Registration of the get_author_papers tool in the MCP server's list_tools() function, including name, description, and input schema.Tool( name="get_author_papers", description=( "Find all papers by a specific author. " "Returns list of papers with citations and publication details." ), inputSchema={ "type": "object", "properties": { "author": { "type": "string", "description": "Author name (e.g., 'Coelho, P.' or 'Coelho, Paula')", }, "max_results": { "type": "integer", "description": "Maximum number of results (default: 20, max: 100)", "default": 20, }, "sort": { "type": "string", "description": "Sort by 'date' or 'citation_count'", "enum": ["date", "citation_count"], "default": "date", }, }, "required": ["author"], }, ),