MCP server returns parquet handles instead of rows, cutting 3.2M tokens to 1,700

Daniel_Aperiodic · reddit · 2026-11-17

Aperiodic's founder details how their MCP server handles big market datasets: one month of 5-minute flow data for a single symbol is 8k+ rows by 35+ columns — roughly 3.2M tokens as JSON, far beyond any model context.

Their fix: tools return a lightweight 'handle' instead of data. getdata returns signed parquet URLs (valid 1 hour), schema, row counts, per-column min/max/null stats read from parquet footers, five sample rows, and a polars loading snippet — about 1,700 tokens total. The agent's code downloads the file; the model never sees the rows.

For clients that can't run code, a summarize tool computes stats, correlation matrices, or resamples series to ≤500 points server-side; search/fetch exist to match ChatGPT connectors' expected shape. The author admits Glama scored the tool definitions 3.6/5 due to mixed naming conventions, and openly asks for better solutions for sandboxes that can't fetch external URLs at all.

Original post →

More from coding & agent

coding & agent channel →