Skip to main content
Glama

referenced_works_in_paper

Retrieve the list of works cited in a specific academic paper using the OpenAlex API to support research analysis and literature review.

Instructions

Gets referenced works used in the specified paper using the OpenAlex API. Note: May return empty if the paper's full text is inaccessible.

Args: paper_id: An OpenAlex Work ID of the target paper. e.g., "https://openalex.org/W123456789"

Returns: A JSON object containing a list of paper ids used in the work, or an error message if the fetch fails.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
paper_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataNo
countNo

Implementation Reference

  • The main handler function for the 'referenced_works_in_paper' tool. It is decorated with @mcp.tool, which also serves as the registration. Fetches the paper details from OpenAlex API using the provided paper_id and extracts/returns the list of referenced works.
    @mcp.tool
    async def referenced_works_in_paper(
            paper_id: str,
    ) -> ListResult:
        """
        Gets referenced works used in the specified paper using the OpenAlex API.
        Note: May return empty if the paper's full text is inaccessible.
    
        Args:
            paper_id: An OpenAlex Work ID of the target paper. e.g., "https://openalex.org/W123456789"
    
        Returns:
            A JSON object containing a list of paper ids used in the work, or an error message if the fetch fails.
        """
    
        # Fetches search results from the OpenAlex API
        async with RequestAPI("https://api.openalex.org", default_params={"mailto": OPENALEX_MAILTO}) as api:
            logger.info(f"Fetching referenced works for paper_id={paper_id}")
            try:
                result = await api.aget(f"/works/{paper_id}")
    
                # Returns a message for when the search results are empty
                if result is None or len(result.get("referenced_works", []) or []) == 0:
                    error_message = f"No referenced works found for paper_id={paper_id}."
                    logger.info(error_message)
                    raise ToolError(error_message)
    
                # Successfully returns the searched papers
                works = result.get("referenced_works", []) or []
                success_message = f"Retrieved {len(works)} referenced works for paper_id={paper_id}."
                logger.info(success_message)
                return ListResult(data=works, count=len(works))
            except httpx.HTTPStatusError as e:
                error_message = f"Request failed with status: {e.response.status_code}"
                logger.error(error_message)
                raise ToolError(error_message)
            except httpx.RequestError as e:
                error_message = f"Network error: {str(e)}"
                logger.error(error_message)
                raise ToolError(error_message)
  • src/server.py:309-309 (registration)
    The @mcp.tool decorator registers the 'referenced_works_in_paper' tool with the FastMCP server.
    @mcp.tool
Behavior4/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 effectively describes key behaviors: it uses the OpenAlex API, may return empty results if full text is inaccessible, and returns a JSON object with a list of paper ids or an error message on failure. This covers operational context and error handling, though it could add more on rate limits or authentication needs.

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

Conciseness5/5

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

The description is well-structured and front-loaded with the core purpose, followed by a note on limitations, and then clear sections for Args and Returns. Every sentence adds value without redundancy, making it efficient and easy to parse for an AI agent.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's low complexity (1 parameter), no annotations, and the presence of an output schema (which handles return values), the description is complete enough. It covers purpose, usage notes, parameter semantics, and return behavior, providing all necessary context for effective tool invocation without overloading with unnecessary details.

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 input schema has 0% description coverage, so the description must compensate. It adds meaningful semantics by explaining that 'paper_id' is 'An OpenAlex Work ID of the target paper' and provides an example format ('https://openalex.org/W123456789'), which clarifies usage beyond the schema's basic string type. However, it does not detail constraints like valid ID patterns or length, keeping it from a score of 5.

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: 'Gets referenced works used in the specified paper using the OpenAlex API.' It specifies the verb ('Gets'), resource ('referenced works'), and target ('specified paper'), but does not explicitly differentiate it from sibling tools like 'related_works_of_paper' or 'works_citing_paper', which prevents a score of 5.

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

Usage Guidelines3/5

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

The description provides implied usage guidance through the note about potential empty returns when 'the paper's full text is inaccessible,' which suggests when this tool might not be effective. However, it lacks explicit guidance on when to use this tool versus alternatives like 'related_works_of_paper' or 'works_citing_paper,' and does not mention prerequisites or exclusions.

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/ErikNguyen20/ScholarScope-MCP'

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