ai_token_trim
AI Token Trimmer: shorten text before sending it to an AI model (rules only, no AI cost). Returns the trimmed text and an estimated token saving.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"text": "<text>"
},
"name": "ai_token_trim"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | The text to process, plain UTF-8, for example: The quick brown fox. | |
| query | No | Query as text. | |
| dedupe | No | true or false: dedupe. Default false. | |
| maxTokens | No | Max tokens (50 to 200000) as a plain number, for example 50. | |
| stripFooters | No | true or false: strip footers. Default false. |