OptionalclearOptionalclearWhether to clear the originating tool call parameters on the AI message.
OptionalexcludeList of tool names to exclude from clearing.
OptionalkeepContext retention policy applied after editing. Specify how many tool results to preserve using messages, tokens, or fraction.
Optionalfraction?: numberFraction of the model's context size to keep
Optionalmessages?: numberOptionaltokens?: numberNumber of tokens to keep
OptionalkeepOptionalplaceholderPlaceholder text inserted for cleared tool outputs.
OptionaltriggerTrigger conditions for context editing. Can be a single condition object (all properties must be met) or an array of conditions (any condition must be met).
Optionalfraction?: numberFraction of the model's context size to use as the trigger
Optionalmessages?: numberNumber of messages to use as the trigger
Optionaltokens?: numberNumber of tokens to use as the trigger
Optionalfraction?: numberFraction of the model's context size to use as the trigger
Optionalmessages?: numberNumber of messages to use as the trigger
Optionaltokens?: numberNumber of tokens to use as the trigger
// Single condition: trigger if tokens >= 100000 AND messages >= 50
trigger: { tokens: 100000, messages: 50 }
// Multiple conditions: trigger if (tokens >= 100000 AND messages >= 50) OR (tokens >= 50000 AND messages >= 100)
trigger: [
{ tokens: 100000, messages: 50 },
{ tokens: 50000, messages: 100 }
]
// Fractional trigger: trigger at 80% of model's max input tokens
trigger: { fraction: 0.8 }
Optionaltrigger
Configuration for clearing tool outputs when token limits are exceeded.