MCPcopy Index your code
hub / github.com/claude-code-best/claude-code / getSearchExtraToolsMode

Function getSearchExtraToolsMode

src/utils/searchExtraTools.ts:170–192  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

168 * (unset) tst (default: always defer non-core tools)
169 */
170export function getSearchExtraToolsMode(): SearchExtraToolsMode {
171 // CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS still acts as a kill switch
172 // for tool search, even though we no longer send beta headers.
173 // Users who set this flag explicitly opt out of tool search.
174 if (isEnvTruthy(process.env.CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS)) {
175 return 'standard'
176 }
177
178 const value = process.env.ENABLE_SEARCH_EXTRA_TOOLS
179
180 // Handle auto:N syntax - check edge cases first
181 const autoPercent = value ? parseAutoPercentage(value) : null
182 if (autoPercent === 0) return 'tst' // auto:0 = always enabled
183 if (autoPercent === 100) return 'standard'
184 if (isAutoSearchExtraToolsMode(value)) {
185 return 'tst-auto' // auto or auto:1-99
186 }
187
188 if (isEnvTruthy(value)) return 'tst'
189 if (isEnvDefinedFalsy(process.env.ENABLE_SEARCH_EXTRA_TOOLS))
190 return 'standard'
191 return 'tst' // default: always defer non-core tools
192}
193
194/**
195 * Check if tool search *might* be enabled (optimistic check).

Callers 2

Calls 4

parseAutoPercentageFunction · 0.85
isEnvDefinedFalsyFunction · 0.85
isEnvTruthyFunction · 0.70

Tested by

no test coverage detected