count_tokens
Estimate token counts for text or files before running local agents or summaries, so you can check if input fits within the model context limit.
Instructions
Estimate token counts for text/files (chars/4 heuristic — ±20% vs a real tokenizer; for input sizing, not billing). Use before run_local_agent/summarize to check fit vs num_ctx.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| glob | No | Glob pattern, e.g. 'src/**/*.ts' | |
| path | No | Single file path (read server-side — never enters your context) | |
| text | No | Inline text instead of files | |
| paths | No | Multiple file paths |