protocol_comparison
Compare power limits and key parameters across wireless protocols to select technologies or understand coexistence for regulatory compliance.
Instructions
Compare power limits and key parameters across wireless protocols. Useful for selecting technologies or understanding coexistence.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| region | No | Regulatory region for comparison | |
| band | No | Frequency band to compare across |
Implementation Reference
- src/mcp_emc_regulations/tools/wireless.py:16-109 (registration)The 'protocol_comparison' tool is registered inside the WirelessTools class via a Tool object at line 87-108, and its handler dispatch is at line 118-119 in call_tool.
class WirelessTools(ToolModule): def list_tools(self) -> list[Tool]: return [ Tool( name="wifi_limits", description=( "Get WiFi regulatory limits for a given band, protocol, and region. " "Covers 2.4 GHz, 5 GHz (UNII-1/2A/2C/3), 6 GHz (LPI/SP/VLP), and sub-1 GHz (802.11ah). " "Returns max power, EIRP, DFS requirements, channel plans." ), inputSchema={ "type": "object", "properties": { "band": { "type": "string", "enum": ["2.4ghz", "5ghz", "5ghz_unii1", "5ghz_unii2a", "5ghz_unii2c", "5ghz_unii3", "6ghz_lpi", "6ghz_sp", "6ghz_vlp", "sub_1ghz", "all"], "description": "WiFi band to query", }, "region": { "type": "string", "enum": ["fcc", "etsi", "ised", "japan", "all"], "description": "Regulatory region", }, "protocol": { "type": "string", "enum": ["802.11b", "802.11g", "802.11n", "802.11ac", "802.11ax", "802.11be", "802.11ah"], "description": "WiFi protocol version", }, }, }, ), Tool( name="ble_limits", description=( "Get Bluetooth Low Energy (BLE) regulatory limits. " "Returns power classes, channel plan, and regulatory limits per region." ), inputSchema={ "type": "object", "properties": { "region": { "type": "string", "enum": ["fcc", "etsi", "ised", "japan", "korea", "all"], "description": "Regulatory region", }, }, }, ), Tool( name="protocol_limits", description=( "Get regulatory limits for short-range wireless protocols: " "Zigbee/Thread/Matter, LoRa/LoRaWAN, UWB, Wi-SUN, DECT, NB-IoT, LTE-M." ), inputSchema={ "type": "object", "properties": { "protocol": { "type": "string", "enum": ["zigbee", "lora", "uwb", "wisun", "dect", "nb_iot", "lte_m"], "description": "Wireless protocol", }, "region": { "type": "string", "enum": ["fcc", "etsi", "ised", "japan", "korea", "all"], "description": "Regulatory region", }, }, "required": ["protocol"], }, ), Tool( name="protocol_comparison", description=( "Compare power limits and key parameters across wireless protocols. " "Useful for selecting technologies or understanding coexistence." ), inputSchema={ "type": "object", "properties": { "region": { "type": "string", "enum": ["fcc", "etsi", "all"], "description": "Regulatory region for comparison", }, "band": { "type": "string", "enum": ["2.4ghz", "sub_1ghz", "all"], "description": "Frequency band to compare across", }, }, }, ), ] - Input/output schema for 'protocol_comparison': accepts 'region' (fcc/etsi/all) and 'band' (2.4ghz/sub_1ghz/all). No required fields.
Tool( name="protocol_comparison", description=( "Compare power limits and key parameters across wireless protocols. " "Useful for selecting technologies or understanding coexistence." ), inputSchema={ "type": "object", "properties": { "region": { "type": "string", "enum": ["fcc", "etsi", "all"], "description": "Regulatory region for comparison", }, "band": { "type": "string", "enum": ["2.4ghz", "sub_1ghz", "all"], "description": "Frequency band to compare across", }, }, }, ), - The _protocol_comparison static method implements the tool logic. It compares power limits and key parameters across wireless protocols (WiFi, BLE, Zigbee/Thread for 2.4 GHz; LoRa, Wi-SUN, Wi-Fi HaLow for sub-1 GHz) for a given region and band, returning formatted text output.
def _protocol_comparison(arguments: dict[str, Any]) -> list[TextContent]: region = arguments.get("region", "fcc") band = arguments.get("band", "2.4ghz") result = f"Wireless Protocol Comparison ({region.upper()}, {band})\n{'=' * 60}\n\n" if band in ["2.4ghz", "all"]: result += "## 2.4 GHz Band Protocols:\n\n" result += f"{'Protocol':<20} {'Max EIRP':>10} {'Modulation':<15} {'Data Rate':<15} {'Range':<10}\n" result += "-" * 70 + "\n" wifi_24 = WIFI.get("bands", {}).get("2_4ghz", {}).get("regions", {}).get(region, {}) if wifi_24: eirp = wifi_24.get("max_eirp_dbm", "?") result += f"{'WiFi (802.11ax)':<20} {str(eirp) + ' dBm':>10} {'OFDMA':<15} {'9.6 Gbps':<15} {'70m':<10}\n" ble_reg = BLUETOOTH.get("bluetooth_le", {}).get("regions", {}).get(region, {}) if ble_reg: eirp = ble_reg.get("max_eirp_dbm", "?") result += f"{'BLE 5.x':<20} {str(eirp) + ' dBm':>10} {'FHSS GFSK':<15} {'2 Mbps':<15} {'100m':<10}\n" zigbee_24 = SHORT_RANGE.get("protocols", {}).get("zigbee", {}).get("bands", {}).get("2_4ghz", {}).get("regions", {}).get(region, {}) if zigbee_24: eirp = zigbee_24.get("max_eirp_dbm", zigbee_24.get("max_conducted_power_dbm", "?")) result += f"{'Zigbee/Thread':<20} {str(eirp) + ' dBm':>10} {'O-QPSK DSSS':<15} {'250 kbps':<15} {'100m':<10}\n" if band in ["sub_1ghz", "all"]: result += "\n## Sub-1 GHz Band Protocols:\n\n" result += f"{'Protocol':<20} {'Max EIRP':>10} {'Band':<18} {'Data Rate':<15} {'Range':<10}\n" result += "-" * 73 + "\n" band_key = "us_915" if region == "fcc" else "eu_868" lora_band = SHORT_RANGE.get("protocols", {}).get("lora", {}).get("bands", {}).get(band_key, {}) lora_reg = lora_band.get("regions", {}).get(region if region != "fcc" else "fcc", {}) if lora_reg: eirp = lora_reg.get("max_eirp_dbm", lora_reg.get("max_conducted_power_dbm", "?")) freq = lora_band.get("frequency_mhz", ["?", "?"]) result += f"{'LoRa':<20} {str(eirp) + ' dBm':>10} {str(freq[0]) + '-' + str(freq[1]) + ' MHz':<18} {'0.3-50 kbps':<15} {'15 km':<10}\n" wisun_band = SHORT_RANGE.get("protocols", {}).get("wisun", {}).get("bands", {}).get(band_key, {}) wisun_reg = wisun_band.get("regions", {}).get(region if region != "fcc" else "fcc", {}) if wisun_reg: eirp = wisun_reg.get("max_eirp_dbm", wisun_reg.get("max_conducted_power_dbm", "?")) result += f"{'Wi-SUN':<20} {str(eirp) + ' dBm':>10} {'902-928 MHz':<18} {'50-800 kbps':<15} {'5 km':<10}\n" halow = WIFI.get("bands", {}).get("sub_1ghz", {}).get("regions", {}).get(region, {}) if halow: eirp = halow.get("max_eirp_dbm", halow.get("max_conducted_power_dbm", "?")) result += f"{'Wi-Fi HaLow':<20} {str(eirp) + ' dBm':>10} {'902-928 MHz':<18} {'347 Mbps':<15} {'1 km':<10}\n" return [TextContent(type="text", text=result)] - Dispatch routing in call_tool: when name='protocol_comparison', it delegates to _protocol_comparison.
elif name == "protocol_comparison": return self._protocol_comparison(arguments) - The ToolModule base class that WirelessTools extends, providing the abstract interface (list_tools, call_tool, handles) for all tool modules.
class ToolModule(ABC): """Abstract base for a group of related MCP tools.""" @abstractmethod def list_tools(self) -> list[Tool]: """Return the tools provided by this module.""" ... @abstractmethod async def call_tool(self, name: str, arguments: dict) -> list[TextContent]: """Handle a tool invocation. Only called when ``handles(name)`` is True.""" ... def handles(self, name: str) -> bool: """Return True if this module owns *name*.""" return name in {t.name for t in self.list_tools()}