MCPcopy Index your code
hub / github.com/github/docs / getDefaultTool

Function getDefaultTool

components/article/ToolPicker.tsx:32–44  ·  view source on GitHub ↗
(defaultTool: string | undefined, detectedTools: Array<string>)

Source from the content-addressed store, hash-verified

30}
31
32function getDefaultTool(defaultTool: string | undefined, detectedTools: Array<string>): string {
33 // If there is a default tool and the tool is present on this page
34 if (defaultTool && detectedTools.includes(defaultTool)) return defaultTool
35
36 // Default to webui if present (this is generally the case where we show UI/CLI/Desktop info)
37 if (detectedTools.includes('webui')) return 'webui'
38
39 // Default to cli if present (this is generally the case where we show curl/CLI info)
40 if (detectedTools.includes('cli')) return 'cli'
41
42 // Otherwise, just choose the first detected tool
43 return detectedTools[0]
44}
45
46const toolQueryKey = 'tool'
47export const ToolPicker = () => {

Callers 1

ToolPickerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected