MCPcopy Create free account
hub / github.com/ChromeDevTools/chrome-devtools-mcp / sortTools

Function sortTools

scripts/generate-docs.ts:95–107  ·  view source on GitHub ↗
(a: ToolWithAnnotations, b: ToolWithAnnotations)

Source from the content-addressed store, hash-verified

93}
94
95function sortTools(a: ToolWithAnnotations, b: ToolWithAnnotations): number {
96 const aHasConditions = Boolean(a.annotations?.conditions?.length > 0);
97 const bHasConditions = Boolean(b.annotations?.conditions?.length > 0);
98
99 if (aHasConditions && !bHasConditions) {
100 return 1;
101 }
102 if (!aHasConditions && bHasConditions) {
103 return -1;
104 }
105
106 return a.name.localeCompare(b.name);
107}
108
109function generateToolsTOC(
110 categories: Record<string, ToolWithAnnotations[]>,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected