You're viewing a demo portfolio

Join the waitlist
PRSM

truncate_to_tokens

Active

Tool of IA-QA — 130+ QA & Dev Tools for AI Agents

declared in 1.0.0

Truncate text to at most N tokens (cl100k_base: ~4 chars/token) to avoid exceeding an LLM context window. Optionally keeps the end of the text instead of the start (useful for keeping recent conversation history). Reports whether truncation occurred and the estimated token count.

Parameters schema

{
  "type": "object",
  "required": [
    "input",
    "max_tokens"
  ],
  "properties": {
    "input": {
      "type": "string",
      "description": "Text to truncate"
    },
    "from_end": {
      "type": "boolean",
      "description": "Keep the end of the text instead of the start (default: false)"
    },
    "max_tokens": {
      "type": "number",
      "description": "Maximum number of tokens to keep"
    }
  }
}

What this tool wraps· 0 endpoints

min confidence0.700.50

No endpoints wrapped at confidence ≥ 0.50.

Parent server

IA-QA — 130+ QA & Dev Tools for AI Agents

https://github.com/jcjamet/ia-qa

1/7 registries
View full server →