MCPcopy Create free account
hub / github.com/Noumena-Network/code / parseCliToolChoice

Function parseCliToolChoice

src/main.tsx:231–245  ·  view source on GitHub ↗
(rawValue: string)

Source from the content-addressed store, hash-verified

229profileCheckpoint('main_tsx_imports_loaded');
230
231function parseCliToolChoice(rawValue: string):
232 | { type: 'auto' }
233 | { type: 'any' }
234 | { type: 'tool'; name: string } {
235 const value = rawValue.trim()
236 const normalized = value.toLowerCase()
237 if (normalized === 'auto') return { type: 'auto' }
238 if (normalized === 'any' || normalized === 'required') return { type: 'any' }
239 if (value.length === 0) {
240 throw new InvalidArgumentError(
241 '--tool-choice must be auto, any, or a tool name',
242 )
243 }
244 return { type: 'tool', name: value }
245}
246
247function getCliToolChoiceOverride():
248 | { type: 'auto' }

Callers 1

getCliToolChoiceOverrideFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected