-
Notifications
You must be signed in to change notification settings - Fork 41
Add capability of disabling tools #119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add capability of disabling tools #119
Conversation
Signed-off-by: zemin-piao <[email protected]>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
| disabled_tools_env = os.getenv("SHS_GLOBAL_DISABLED_TOOLS", "") | ||
| if disabled_tools_env: | ||
| disabled_tools = [tool.strip() for tool in disabled_tools_env.split(",")] | ||
| if tool_name in disabled_tools: | ||
| return False | ||
|
|
||
| # Check configuration file | ||
| try: | ||
| config = Config.from_file(config_path) | ||
|
|
||
| # Check if any server has this tool disabled | ||
| for server_config in config.servers.values(): | ||
| if tool_name in server_config.disabled_tools: | ||
| return False | ||
|
|
||
| except Exception as e: | ||
| logger.error(f"Error loading configuration and loading disabled tools: {e}") | ||
| return True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possible to use the settings object for this instead?
🔄 Pull Request
📝 Description
Add capability of disabling tools.
When integrating with multiple (N) spark history servers, the number of tools mcp server provides will be 18*N which is pretty high. It produces some verbosity for users listing available mcp tools.
🎯 Type of Change
🧪 Testing
task test)🔬 Test Commands Run
🛠️ New Tools Added (if applicable)
new_tool_name📸 Screenshots (if applicable)
✅ Checklist
📚 Related Issues
Fixes #(issue number)
Related to #(issue number)
🤔 Additional Context
🎉 Thank you for contributing! Your effort helps make Spark monitoring more intelligent.