Support plural names/keys in enable/disable API

Change enable() and disable() to accept sets: names, keys, tags.
Use key-based disable for decorator enabled=False to scope exactly.
This commit is contained in:
Jeremiah Lowin 2026-01-18 14:58:29 -05:00
commit 84d7d3b281
21 changed files with 167 additions and 136 deletions

View file

@ -38,7 +38,7 @@ from fastmcp.server.transforms import Enabled
Enabled(False, tags=frozenset({"internal"}))
# Re-enable specific tool (override earlier disable)
Enabled(True, name="safe_tool")
Enabled(True, names={"safe_tool"})
# Allowlist via composition:
Enabled(False, match_all=True) # disable everything