Skip to main content
Glama
khushiiagrawal

MCP Research Server

extract_info

Search for specific paper details across all topic directories using a paper ID. Returns JSON-formatted research information or an error if not found.

Instructions

Search for information about a specific paper across all topic directories.

Args: paper_id: The ID of the paper to look for

Returns: JSON string with paper information if found, error message if not found

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
paper_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The extract_info tool handler function that searches for information about a specific paper across all topic directories in the papers folder. It iterates through topic directories, reads papers_info.json files, and returns the paper information as a JSON string if found.
    @mcp.tool()
    def extract_info(paper_id: str) -> str:
        """
        Search for information about a specific paper across all topic directories.
        
        Args:
            paper_id: The ID of the paper to look for
            
        Returns:
            JSON string with paper information if found, error message if not found
        """
     
        for item in os.listdir(PAPER_DIR):
            item_path = os.path.join(PAPER_DIR, item)
            if os.path.isdir(item_path):
                file_path = os.path.join(item_path, "papers_info.json")
                if os.path.isfile(file_path):
                    try:
                        with open(file_path, "r") as json_file:
                            papers_info = json.load(json_file)
                            if paper_id in papers_info:
                                return json.dumps(papers_info[paper_id], indent=2)
                    except (FileNotFoundError, json.JSONDecodeError) as e:
                        print(f"Error reading {file_path}: {str(e)}")
                        continue
        
        return f"There's no saved information related to paper {paper_id}."
  • The @mcp.tool() decorator registers the extract_info function as an MCP tool with the FastMCP server.
    @mcp.tool()
    def extract_info(paper_id: str) -> str:
  • Type hints defining the input schema (paper_id: str) and output schema (-> str) for the extract_info tool.
    def extract_info(paper_id: str) -> str:
  • Alternative/backup implementation of the extract_info tool handler function in the L-5 version file. Identical logic to research_server.py - searches for paper information across topic directories.
    @mcp.tool()
    def extract_info(paper_id: str) -> str:
        """
        Search for information about a specific paper across all topic directories.
    
        Args:
            paper_id: The ID of the paper to look for
    
        Returns:
            JSON string with paper information if found, error message if not found
        """
    
        for item in os.listdir(PAPER_DIR):
            item_path = os.path.join(PAPER_DIR, item)
            if os.path.isdir(item_path):
                file_path = os.path.join(item_path, "papers_info.json")
                if os.path.isfile(file_path):
                    try:
                        with open(file_path, "r") as json_file:
                            papers_info = json.load(json_file)
                            if paper_id in papers_info:
                                return json.dumps(papers_info[paper_id], indent=2)
                    except (FileNotFoundError, json.JSONDecodeError) as e:
                        print(f"Error reading {file_path}: {str(e)}")
                        continue
    
        return f"There's no saved information related to paper {paper_id}."
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden. It successfully discloses return behavior ('JSON string with paper information if found, error message if not found') and scope ('across all topic directories'). However, it lacks explicit safety classification (read-only vs destructive) or side-effect disclosure despite the implicit 'search' verb.

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 uses a clean, structured format with clear 'Args' and 'Returns' sections. It is appropriately concise with no redundant or wasted sentences; every clause provides specific functional information.

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

Completeness4/5

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

For a single-parameter lookup tool with an output schema present, the description provides adequate completeness. It documents the sole parameter (compensating for schema gaps) and summarizes return behavior, which is sufficient given the tool's low complexity.

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?

Given 0% schema description coverage, the Args section effectively compensates by defining 'paper_id' as 'The ID of the paper to look for.' This adds necessary semantic meaning that the raw schema lacks, clearly indicating the parameter represents a paper identifier.

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 'Search[es] for information about a specific paper across all topic directories,' providing specific verb (search), resource (paper information), and scope (all topic directories). It implicitly distinguishes from sibling 'search_papers' by emphasizing 'specific paper' lookup by ID rather than general searching.

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 explicit guidance on when to use this tool versus the sibling 'search_papers'. While it implies usage by stating it looks for a 'specific paper' (suggesting use when paper_id is known), it fails to explicitly contrast with alternatives or state prerequisites.

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/khushiiagrawal/MCP_Research_Assistant'

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