Skip to main content
Glama

get_cached_result

Retrieve cached data from portfolio analysis with pagination support. Access specific pages of large datasets like price series and returns without overloading context windows.

Instructions

Retrieve a cached result, optionally with pagination.

Use this to:

  • Get a preview of a cached value

  • Paginate through large sequences, price series, or returns data

  • Access specific pages of a cached result

Args: ref_id: The reference ID returned by tools (e.g., from generate_price_series). page: Page number (1-indexed). If not provided, returns the default preview. page_size: Items per page. Default varies by data type (typically 50).

Returns: Dictionary containing: - ref_id: The reference ID - preview: The data for the current page/preview - preview_strategy: How the preview was generated (sample, truncate, paginate) - total_items: Total number of items in the full dataset - page: Current page number (if paginated) - total_pages: Total pages available (if paginated)

Example: ``` # Generate large price series (returns ref_id + preview) result = generate_price_series(symbols=["AAPL", "GOOG"], days=500)

# Get page 2 of the cached data page2 = get_cached_result(ref_id=result["ref_id"], page=2, page_size=50) # Get page 5 page5 = get_cached_result(ref_id=result["ref_id"], page=5) ```

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ref_idYes
pageNo
page_sizeNo

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/l4b4r4b4b4/portfolio-mcp'

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