Context Pruner
context_prunerAnalyzes a list of files or tools currently in an agent's context and recommends which can be safely dropped for the current task — reducing token usage without losing task-critical information. Use when: context window is filling up, you have many files open and need to trim, or an agent wants to know which loaded resources are irrelevant to the active task. Scope: local analysis only — scores items by keyword overlap with the task description. No network access, no file reads. Not for: compressing file content (use token_optimizer), managing persisted memory facts (use memory_write/memory_read), or reading files (use get_file).
How to use context_pruner
Provide only the required inputs below. Start with the smallest scope that answers the task, then review the risk properties before an agent executes the call.
Risk and execution properties
Read only: yes
Destructive: no
Idempotent: yes
Open world: no — operates locally or through configured services
Inputs
taskstringrequiredOne or two sentences describing the current task or goal. Used as the relevance signal.
itemsarrayrequiredList of context items to evaluate. Each item is a string: a file path, tool name, or short description.
keep_top_nintegerHow many items to recommend keeping (highest relevance). Default: 5. Items beyond this threshold are candidates to drop.
Default: 5
verbosebooleanIf true, include per-item relevance scores and the matched keywords. Default: false.
Default: false
Example input
{
"task": "<string>",
"items": "<array>",
"keep_top_n": 5,
"verbose": false
}Browse or search the full 74-tool reference to choose the smallest suitable capability.
Browse all tools →