Skip to main content
Glama
rspace-os

RSpace MCP Server

Official
by rspace-os

search_recent_documents

Find recently modified documents in RSpace by specifying a timeframe and optional text search to locate current research data.

Instructions

Search for recently modified documents

Usage: Find documents modified within a specific timeframe

Parameters:

  • days_back: Number of days to look back

  • query: Optional text search within recent documents

  • page_size: Number of results to return

Returns: Dictionary with recent documents

Example: search_recent_documents(7, "experiment")

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
days_backNo
queryNo
page_sizeNo

Implementation Reference

  • main.py:313-352 (handler)
    The handler function implementing the search_recent_documents tool. Registered via @mcp.tool decorator. Searches RSpace documents modified within the last N days, optionally filtered by a query string, using AdvancedQueryBuilder and eln_cli.get_documents_advanced_query.
    @mcp.tool(tags={"rspace", "search"})
    def search_recent_documents(
        days_back: int = 7,
        query: str = None,
        page_size: int = 20
    ) -> dict:
        """
        Search for recently modified documents
        
        Usage: Find documents modified within a specific timeframe
        
        Parameters:
        - days_back: Number of days to look back
        - query: Optional text search within recent documents
        - page_size: Number of results to return
        
        Returns: Dictionary with recent documents
        
        Example: search_recent_documents(7, "experiment")
        """
        from datetime import datetime, timedelta
        
        # Calculate date range - RSpace expects "startDate;endDate" format for date ranges
        start_date = (datetime.now() - timedelta(days=days_back)).strftime("%Y-%m-%d")
        end_date = datetime.now().strftime("%Y-%m-%d")
        date_range = f"{start_date};{end_date}"
        
        builder = AdvancedQueryBuilder(operator="and")
        builder.add_term(date_range, AdvancedQueryBuilder.QueryType.LAST_MODIFIED)
        
        if query:
            builder.add_term(query, AdvancedQueryBuilder.QueryType.GLOBAL)
        
        advanced_query = builder.get_advanced_query()
        return eln_cli.get_documents_advanced_query(
            advanced_query=advanced_query,
            order_by="lastModified desc",
            page_number=0,
            page_size=page_size
        )

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/rspace-os/rspace-mcp'

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