(tool: ToolWithAnnotations)
| 86 | } |
| 87 | |
| 88 | function hasOffByDefaultConditions(tool: ToolWithAnnotations): boolean { |
| 89 | for (const condition of tool.annotations?.conditions || []) { |
| 90 | if (condition === 'slim') { |
| 91 | continue; |
| 92 | } |
| 93 | const option = mcpOptions[condition]; |
| 94 | if (!option || !('default' in option) || option.default !== true) { |
| 95 | return true; |
| 96 | } |
| 97 | } |
| 98 | return false; |
| 99 | } |
| 100 | |
| 101 | function sortTools(a: ToolWithAnnotations, b: ToolWithAnnotations): number { |
| 102 | const aHasConditions = hasOffByDefaultConditions(a); |