Add: Config for tool enable/disable, BETA warnings

Config system:
- 10 env vars to enable/disable each tool
- Disabled by default: get_deals_by_radius, get_street_deals, get_market_activity_metrics
- Enabled by default: all other tools

BETA warnings:
- analyze_market_trends: added BETA notice
- compare_addresses: added BETA notice

Tests:
- 17 tests skipped when tools disabled
- All 311 tests pass

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Nitzan Pomerantz
2025-12-06 22:37:55 +02:00
parent 5daaf70021
commit 88ae481e52
6 changed files with 106 additions and 0 deletions
+46
View File
@@ -117,6 +117,52 @@ class GovmapConfig:
default_factory=lambda: os.getenv("GOVMAP_USER_AGENT", "NadlanMCP/1.0.0")
)
# MCP Tool Availability (enable/disable specific tools)
tool_autocomplete_address_enabled: bool = field(
default_factory=lambda: os.getenv("TOOL_AUTOCOMPLETE_ADDRESS_ENABLED", "true").lower()
== "true"
)
tool_get_deals_by_radius_enabled: bool = field(
default_factory=lambda: os.getenv("TOOL_GET_DEALS_BY_RADIUS_ENABLED", "false").lower()
== "true"
)
tool_get_street_deals_enabled: bool = field(
default_factory=lambda: os.getenv("TOOL_GET_STREET_DEALS_ENABLED", "false").lower()
== "true"
)
tool_get_neighborhood_deals_enabled: bool = field(
default_factory=lambda: os.getenv("TOOL_GET_NEIGHBORHOOD_DEALS_ENABLED", "true").lower()
== "true"
)
tool_find_recent_deals_for_address_enabled: bool = field(
default_factory=lambda: os.getenv(
"TOOL_FIND_RECENT_DEALS_FOR_ADDRESS_ENABLED", "true"
).lower()
== "true"
)
tool_analyze_market_trends_enabled: bool = field(
default_factory=lambda: os.getenv("TOOL_ANALYZE_MARKET_TRENDS_ENABLED", "true").lower()
== "true"
)
tool_compare_addresses_enabled: bool = field(
default_factory=lambda: os.getenv("TOOL_COMPARE_ADDRESSES_ENABLED", "true").lower()
== "true"
)
tool_get_valuation_comparables_enabled: bool = field(
default_factory=lambda: os.getenv("TOOL_GET_VALUATION_COMPARABLES_ENABLED", "true").lower()
== "true"
)
tool_get_deal_statistics_enabled: bool = field(
default_factory=lambda: os.getenv("TOOL_GET_DEAL_STATISTICS_ENABLED", "true").lower()
== "true"
)
tool_get_market_activity_metrics_enabled: bool = field(
default_factory=lambda: os.getenv(
"TOOL_GET_MARKET_ACTIVITY_METRICS_ENABLED", "false"
).lower()
== "true"
)
def __post_init__(self):
"""Validate configuration after initialization."""
self._validate()