Add tool enable/disable and auto-discovery of function names#3
Merged
Conversation
… names The UI no longer requires manually clicking Introspect / Analyze — both run automatically (introspect on provider open / package-command blur; analyze on every code edit, debounced). When discovery succeeds, the tool-name and function-name fields become a dropdown of legal values plus an "Other…" option for free-form entry. Failure is silent: the dropdown only shows "Other…" so users can always type a custom value, matching the previous behaviour. Each tool now has a per-card enable/disable switch persisted to YAML as `enabled: true|false` (always written; absent means true for backward compatibility with pre-existing YAML files). Disabled tools are kept in the file but skipped during MCP registration, so they never reach the LLM. Every tool is now advertised to MCP clients as `<provider>__<tool>`. The provider name is the YAML filename normalized to `[a-zA-Z0-9-]`. This makes tool-name collisions across providers impossible. Built-in tools follow the same convention: `mcpproxy__listfiles` and `mcpproxy__getfile`. The upstream tool name used when proxying to package subprocesses is still the unprefixed name from the YAML. Tests, README, and the integration shell script are updated accordingly; existing YAML files require no migration. https://claude.ai/code/session_01KRZQTKxffN7toaSDh71D6e
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds the ability to enable/disable individual tools in provider configurations and implements automatic discovery of available function/tool names from code blocks and package introspection. Tools can now be toggled on/off without losing their schema, and the UI provides smart dropdowns for selecting function names when available.
Key Changes
Tool Enable/Disable Feature
enabledfield to tool specs (defaults totruewhen missing)enabled: falseare kept in YAML but not registered with MCP or advertised to the LLM_provider_to_structured()and_structured_to_yaml()now handle theenabledfieldTool Name Prefixing & Normalization
normalize_provider_name()to convert provider names to MCP-safe identifiers ([a-zA-Z0-9-])advertised_tool_name()to create namespaced tool names:<provider>__<tool>register_tool()to accept an optionaladvertised_nameparameter for prefixed registrationregister_provider()to skip disabled tools and register enabled tools with prefixed names__separator:mcpproxy__listfilesandmcpproxy__getfileAuto-Discovery of Function Names
discoverFunctions()JS function that:async deffunction names/api/introspectto get available toolsknownFunctionsarray and displays discovery status/api/extract-functionsendpoint to parse Python code and extract function definitionsUI Improvements
.fn-pick-rowlayout with dropdown + input.badge-disabled,.tool-card.disabled).form-check-input)Wizard Improvements
Testing
normalize_provider_name(),advertised_tool_name(), andtool_is_enabled()register_provider()prefixing and disabled tool filteringenabledfield in tool specs__separator in tool namesNotable Implementation Details
enabledfield is always written explicitly to YAML (never omitted) for clarityenabledfield in existing YAML defaults totruefor backward compatibilityknownFunctions,knownFnStatus,knownFnMessage)_syncFnPick()as user typeshttps://claude.ai/code/session_01KRZQTKxffN7toaSDh71D6e