get_documents
Retrieve recent RSpace documents with pagination to browse and select research data. Returns document metadata for efficient overview.
Instructions
Retrieves recent RSpace documents with pagination
Usage: Get overview of recent documents for browsing/selection Limit: Maximum 200 documents per call for performance Returns: List of document metadata (not full content)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page_size | No |
Implementation Reference
- main.py:116-129 (handler)The handler function implementing the 'get_documents' MCP tool. It retrieves a paginated list of recent RSpace ELN documents using the eln_cli client and returns them as a list of Document objects. Decorated with @mcp.tool for automatic registration.@mcp.tool(tags={"rspace"}) def get_documents(page_size: int = 20) -> list[Document]: """ Retrieves recent RSpace documents with pagination Usage: Get overview of recent documents for browsing/selection Limit: Maximum 200 documents per call for performance Returns: List of document metadata (not full content) """ if page_size > 200 or page_size < 0: raise ValueError("page size must be less than 200") resp = eln_cli.get_documents(page_size=page_size) return resp['documents']
- main.py:35-40 (schema)Pydantic BaseModel defining the output schema for document metadata returned by the get_documents tool.class Document(BaseModel): """ELN Document metadata - used for document listings""" name: str = Field("document's name") globalId: str = Field(description="Global identifier") created: str = Field(description="The document's creation date")
- main.py:116-116 (registration)The @mcp.tool decorator registers the get_documents function as an MCP tool with the 'rspace' tag. FastMCP framework automatically handles tool discovery and server exposure.@mcp.tool(tags={"rspace"})