MCPcopy Index your code
hub / github.com/codeaashu/claude-code / getAutoToolSearchPercentage

Function getAutoToolSearchPercentage

src/utils/toolSearch.ts:83–93  ·  view source on GitHub ↗

* Get the auto-enable percentage from env var or default.

()

Source from the content-addressed store, hash-verified

81 * Get the auto-enable percentage from env var or default.
82 */
83function 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).

Callers 2

checkAutoThresholdFunction · 0.85

Calls 1

parseAutoPercentageFunction · 0.85

Tested by

no test coverage detected