Skip to content

Conversation

zemin-piao
Copy link
Contributor

🔄 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

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to change)
  • 📖 Documentation update
  • 🧪 Test improvement
  • 🔧 Refactoring (no functional changes)

🧪 Testing

  • ✅ All existing tests pass (task test)
  • 🔬 Tested with MCP Inspector
  • 📊 Tested with sample Spark data
  • 🚀 Tested with real Spark History Server (if applicable)

🔬 Test Commands Run

# Example:
# task test
# npx @modelcontextprotocol/inspector uv run -m spark_history_mcp.core.main

🛠️ New Tools Added (if applicable)

  • Tool Name: new_tool_name
  • Purpose: What it does
  • Usage: Example parameters

📸 Screenshots (if applicable)

✅ Checklist

  • 🔍 Code follows project style guidelines
  • 🧪 Added tests for new functionality
  • 📖 Updated documentation (README, TESTING.md, etc.)
  • 🔧 Pre-commit hooks pass
  • 📝 Added entry to CHANGELOG.md (if significant change)

📚 Related Issues

Fixes #(issue number)
Related to #(issue number)

🤔 Additional Context


🎉 Thank you for contributing! Your effort helps make Spark monitoring more intelligent.

Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign nabuskey for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@zemin-piao zemin-piao marked this pull request as ready for review September 28, 2025 20:39
Comment on lines +34 to +51
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
Copy link
Collaborator

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?

@nabuskey nabuskey linked an issue Sep 29, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Too many tools?
2 participants