Skip to main content
Glama

get_paper_abstract

Retrieve complete abstracts with title and metadata for academic papers using OpenAlex paper IDs to support detailed research analysis.

Instructions

Get the full abstract for a specific paper.

Args: paper_id: The OpenAlex paper ID (from search_papers results)

Returns: The paper's abstract text with title and metadata

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
paper_idYes

Implementation Reference

  • The main MCP tool handler for 'get_paper_abstract'. Fetches paper details via PaperFetcher, extracts abstract, and formats response with metadata.
    @mcp.tool() def get_paper_abstract(paper_id: str) -> str: """ Get the full abstract for a specific paper. Args: paper_id: The OpenAlex paper ID (from search_papers results) Returns: The paper's abstract text with title and metadata """ paper = fetcher.fetch_paper_by_id(paper_id) if "error" in paper: return paper["error"] abstract_text = fetcher.get_paper_abstract(paper) result = f"**{paper['title']}**\n" result += f"Authors: {paper['authors']}\n" result += f"Year: {paper['publication_year']}\n" result += f"Citations: {paper['cited_by_count']}\n\n" result += f"**Abstract:**\n{abstract_text}\n" return result
  • Helper method in PaperFetcher class that decodes OpenAlex's inverted index abstract format into readable plain text.
    def get_paper_abstract(self, paper_data: Dict) -> str: """ Convert OpenAlex inverted index abstract to readable text. Args: paper_data: Paper dictionary containing abstract in inverted index format Returns: Readable abstract text """ inverted_index = paper_data.get("abstract") if not inverted_index: return "No abstract available" word_positions = [] for word, positions in inverted_index.items(): for pos in positions: word_positions.append((pos, word)) word_positions.sort(key=lambda x: x[0]) abstract = " ".join([word for _, word in word_positions]) return abstract
  • src/server.py:47-47 (registration)
    The @mcp.tool() decorator registers the get_paper_abstract function as an MCP tool.
    @mcp.tool()
  • Tool schema defined by function signature (paper_id: str) and docstring describing input/output.
    """ Get the full abstract for a specific paper. Args: paper_id: The OpenAlex paper ID (from search_papers results) Returns: The paper's abstract text with title and metadata """

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/DaniManas/ResearchMCP'

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