Add ability to disable tools - #116
Conversation
There was a problem hiding this comment.
这个设计在与已有的环境变量重命名机制共存条件下就显得太臃肿了。建议改成,要禁用一个工具,就将其对应环境变量设为非法值或保留关键字,如"<disabled>""null",之类的,避免任何容易出错的名称问题,也不需要再增添新的环境变量。
不过在“只希望允许个别工具”的场景下,新增一个环境变量可能确实让配置更简洁。值得讨论。 @Aas-ee
6387930 to
30efe28
Compare
|
Your feedback is appreciated, I have updated the change to use the sentinel string " |
There was a problem hiding this comment.
After discussions with other maintainers, we decided to allow only <disabled> as the tool disable flag, and not to include the ambiguous null or other invalid names. In other words, tool disabling is only indicated when and only when the tool name is precisely set to <disabled>, the reserved keyword; other illegal names should only be warned and fallbacked to standard names, instead of disabling that tool.
Also better if provide examples in the README.
d62a48e to
0e86813
Compare
OK excellent, I've updated the PR with your suggested changes. |
|
The new configuration examples: # Disable search tool
MCP_TOOL_SEARCH_NAME=<disabled> npx open-websearch@latestdo not work in bash/zsh. Since the sentinel value itself contains shell-special characters, the docs must show the quoted form: # Disable search tool
MCP_TOOL_SEARCH_NAME='<disabled>' npx open-websearch@latestAlso add a note that on Windows |
Use "<disabled>" as the tool name to disable it.
0e86813 to
06cc75e
Compare
Valid point, I have updated this PR to include these details in the two README files. |
No description provided.