Skip to content
masterclass Buddy

LangChain · Class

ClearToolUsesEdit

ClearToolUsesEdit clears older tool outputs when a conversation reaches a token limit. It preserves recent results and can protect selected tools.

Last updated

Since
v1.4

Syntax

ClearToolUsesEdit(trigger=100000, clear_at_least=0, keep=3, clear_tool_inputs=False, exclude_tools=(), placeholder="[cleared]")

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • ContextEditingMiddleware
  • create_agent

Source: Prebuilt middleware - Docs by LangChain Documentation. Checked 2026-11-03.