Trimming tool results
Your agent asks for the error logs and gets forty thousand lines back. The one line that matters is in there somewhere, and so is everything else, now on every step that follows. Tool output is usually the biggest thing in an agent's context, so it's the first thing to design.
In this lesson you'll learn to
- Explain why tool results dominate an agent's context and how one oversized result harms every later step.
- Design tools that return less by default, with filters, limits, pagination and a concise format.
- Truncate oversized results honestly, telling the model what was cut and how to get more, or offload them to a file.
- Clear or shrink old tool results from the history once they've been used.
Create a free account to open this lesson
It's free. You'll get every free lesson, quizzes that save your progress, daily flashcards and streaks.