get_paper_references
Retrieve papers referenced by a specific academic paper using its ID, with options to limit results and select fields.
Instructions
Get papers referenced by a specific paper.
Args:
paper_id: Paper ID to get references for
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:
List of referenced papers
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| paper_id | Yes | ||
| limit | No | ||
| offset | No | ||
| fields | No |
Implementation Reference
- The handler function for the 'get_paper_references' tool. It is decorated with @mcp.tool() for registration and implements the logic to fetch references for a given paper ID from the Semantic Scholar API, format them using format_paper helper, and return a formatted string.@mcp.tool() async def get_paper_references( paper_id: str, limit: int = 10, offset: int = 0, fields: Optional[str] = None ) -> str: """ Get papers referenced by a specific paper. Args: paper_id: Paper ID to get references for 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: List of referenced papers """ params: Dict[str, Any] = {"limit": min(limit, 1000), "offset": offset} if fields: params["fields"] = fields else: params["fields"] = "paperId,title,authors,year,venue,citationCount" encoded_id = quote(paper_id, safe="") result = await make_api_request(f"paper/{encoded_id}/references", params) if result is None: return "Error: Failed to fetch references" if "error" in result: return f"Error: {result['error']}" references = result.get("data", []) total = result.get("total", 0) if not references: return "No references found for this paper." formatted_references = [] for i, reference in enumerate(references, 1): cited_paper = reference.get("citedPaper", {}) if cited_paper: formatted_references.append(f"{i}. {format_paper(cited_paper)}") result_text = ( f"Found {total} total references (showing {len(formatted_references)}):\n\n" ) result_text += "\n\n".join(formatted_references) return result_text