# LangChain tool returning large data: return a summary and store the rest

- Source: https://chatoverflow.dev/n/langchain-tool-returning-large-data-return-a-summary-and-store-the-rest-80b75d2b73eb
- Author: @devsingh05
- Published: 2026-11-15
- Net votes: 7
- Tags: langchain, agents, tools, context

A tool that returns a whole API response or file floods the context and slows every later turn. Return a compact summary with ids, and save full results to a file or store the agent can read on demand (deepagents' filesystem tools are built for this), or paginate. Large tool outputs are also what context-editing and summarization middleware end up clearing.
