Warn user about excessive non-builtin tools
show a warning in web/'s /settings screen if the user has more than 20 enabled non-builtin tools from all MCP servers combined
I'll help you add a warning in the web app's settings screen when users have more than 20 enabled non-builtin tools. Let me start by exploring the structure.
Find settings page route in web/ directory that manages tool configuration or MCP settings
Based on my search, I found the settings page route and the MCP-related configuration files in the web directory:
Main Settings Page Route:
web/src/routes/settings/+page.svelte- The main settings page that manages tool configuration and MCP settings
MCP-Specific Configuration Files:
web/src/routes/settings/mcp-server-update-form.svelte- Handles adding/updating MCP serversweb/src/routes/settings/mcp-server-section.svelte- Displays and manages MCP server configurationsweb/src/routes/settings/mcp-server-status-dot.svelte- Shows MCP server connection status
Tool Configuration Files:
web/src/routes/settings/tool-settings-section.svelte- Manages tool enable/disable settingsweb/src/routes/settings/tool-providers-table.svelte- Shows available tool providers including MCP serversweb/src/routes/settings/tool-list.svelte- Lists and manages individual toolsweb/src/routes/settings/tool-item.svelte- Individual tool configuration item
Additional Settings Sections:
web/src/routes/settings/auth-settings-section.svelte- Authentication settingsweb/src/routes/settings/amptab-settings-section.svelte- AmpTab feature settingsweb/src/routes/settings/advanced-settings-section.svelte- Advanced settings
Now I have the complete picture. I need to modify tool-settings-section.svelte to add a warning when enabled non-builtin tools exceed 20. Let me make the change:
@@ -70,8 +70,20 @@
let builtinTools = $derived.by(() => {
if (!$tools || $tools instanceof Error) return $tools
return $tools.filter((tool) => tool.spec.source === 'builtin')
})
let enabledNonBuiltinToolsCount = $derived.by(() => {
if (!$tools || $tools instanceof Error) return 0
return $tools.filter(
(tool) =>
tool.enabled &&
tool.spec.source !== 'builtin' &&
!(typeof tool.spec.source === 'object' && 'toolbox' in tool.spec.source),
).length
})
let showTooManyToolsWarning = $derived(enabledNonBuiltinToolsCount > 20)
</script>
<SettingsSection title="Tools">
<!-- Hidden div to trigger initialization of disabledTools value -->
Now let me add the warning UI component. I need to check what warning/alert components are available:
Public
Reference Thread
T-62d6f9c3-4859-4dbe-a0ec-0460e2a3707a