* Get the auto-enable percentage from env var or default.
()
| 81 | * Get the auto-enable percentage from env var or default. |
| 82 | */ |
| 83 | function getAutoToolSearchPercentage(): number { |
| 84 | const value = process.env.ENABLE_TOOL_SEARCH |
| 85 | if (!value) return DEFAULT_AUTO_TOOL_SEARCH_PERCENTAGE |
| 86 | |
| 87 | if (value === 'auto') return DEFAULT_AUTO_TOOL_SEARCH_PERCENTAGE |
| 88 | |
| 89 | const parsed = parseAutoPercentage(value) |
| 90 | if (parsed !== null) return parsed |
| 91 | |
| 92 | return DEFAULT_AUTO_TOOL_SEARCH_PERCENTAGE |
| 93 | } |
| 94 | |
| 95 | /** |
| 96 | * Approximate chars per token for MCP tool definitions (name + description + input schema). |
no test coverage detected