fit_context
Shrink long text, logs, or tool output to a token budget while preserving parts relevant to a query in original order; text that already fits is unchanged.
Instructions
Shrink a long text (a document, log or tool output) to a token budget, keeping the parts that answer the query, in their original order. Text that already fits comes back unchanged.
Args:
text: The text to shrink.
budget: Most tokens to return.
query: Optional question; the parts that answer it are kept first.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | ||
| query | No | ||
| budget | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |