nr_bands_list
List 5G NR bands filtered by frequency range (FR1 sub-6GHz or FR2 mmWave) and US carrier for compliance queries.
Instructions
List all 5G NR bands, optionally filtered by frequency range (FR1 sub-6GHz, FR2 mmWave).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| frequency_range | No | FR1 (sub-6), FR2 (mmWave), or all | |
| carrier | No | Filter by US carrier (att, verizon, tmobile) |
Implementation Reference
- The handler function that executes the nr_bands_list tool logic. Lists all 5G NR bands, optionally filtered by frequency range (FR1/FR2) or US carrier.
def _nr_bands_list(arguments: dict[str, Any]) -> list[TextContent]: freq_range = arguments.get("frequency_range", "all").upper() carrier = arguments.get("carrier", "").lower() if carrier: carrier_bands = NR_BANDS.get("us_carrier_nr_bands", {}).get(carrier, {}) if carrier_bands: result = f"5G NR Bands for {carrier.upper()}\n{'=' * 40}\n\n" result += f"Low-band: {', '.join(carrier_bands.get('low_band', []))}\n" result += f"Mid-band: {', '.join(carrier_bands.get('mid_band', []))}\n" result += f"mmWave: {', '.join(carrier_bands.get('mmwave', []))}\n" if "notes" in carrier_bands: result += f"Notes: {carrier_bands['notes']}\n" else: result = f"Carrier '{carrier}' not found." else: result = f"5G NR Bands\n{'=' * 50}\n\n" if freq_range in ["FR1", "ALL"]: result += "## FR1 (Sub-6 GHz)\n" for band in NR_BANDS.get("fr1_bands", {}).get("bands", []): if "uplink_mhz" in band: result += f" {band['band']:>4}: {band['uplink_mhz'][0]:>4}-{band['uplink_mhz'][1]:<4} MHz ({band['duplex']}) {band.get('name', '')}\n" if freq_range in ["FR2", "ALL"]: result += "\n## FR2 (mmWave)\n" for band in NR_BANDS.get("fr2_bands", {}).get("bands", []): result += f" {band['band']:>4}: {band['range_mhz'][0]:>5}-{band['range_mhz'][1]:<5} MHz {band.get('name', '')}\n" return [TextContent(type="text", text=result)] - The Tool definition with input schema for the nr_bands_list tool, defining optional parameters frequency_range (enum: FR1/FR2/all) and carrier.
Tool( name="nr_bands_list", description="List all 5G NR bands, optionally filtered by frequency range (FR1 sub-6GHz, FR2 mmWave).", inputSchema={ "type": "object", "properties": { "frequency_range": {"type": "string", "enum": ["FR1", "FR2", "all"], "description": "FR1 (sub-6), FR2 (mmWave), or all"}, "carrier": {"type": "string", "description": "Filter by US carrier (att, verizon, tmobile)"}, }, }, - src/mcp_emc_regulations/tools/cellular.py:103-107 (registration)Dispatch in CellularTools.call_tool that routes the 'nr_bands_list' tool name to the _nr_bands_list handler.
elif name == "nr_bands_list": return self._nr_bands_list(arguments) elif name == "frequency_to_band": return self._frequency_to_band(arguments) return [TextContent(type="text", text=f"Unknown cellular tool: {name}")] - Loads NR band data from nr_bands.json into a module-level constant used by the handler.
NR_BANDS = load_json("nr_bands.json") - src/mcp_emc_regulations/registry.py:14-53 (registration)Auto-discovery registry that finds all ToolModule subclasses (including CellularTools) and registers their tools.
class ToolRegistry: """Discovers all :class:`ToolModule` subclasses in the ``tools`` package.""" def __init__(self) -> None: self._modules: list[ToolModule] = [] self._discover() # ------------------------------------------------------------------ # Public API used by server.py # ------------------------------------------------------------------ def list_tools(self) -> list[Tool]: result: list[Tool] = [] for mod in self._modules: result.extend(mod.list_tools()) return result async def call_tool(self, name: str, arguments: dict[str, Any]) -> list[TextContent]: for mod in self._modules: if mod.handles(name): return await mod.call_tool(name, arguments) return [TextContent(type="text", text=f"Unknown tool: {name}")] # ------------------------------------------------------------------ # Auto-discovery # ------------------------------------------------------------------ def _discover(self) -> None: """Import every module in the ``tools`` package and instantiate ToolModules.""" for info in pkgutil.iter_modules(_tools_pkg.__path__, _tools_pkg.__name__ + "."): module = importlib.import_module(info.name) for attr_name in dir(module): attr = getattr(module, attr_name) if ( isinstance(attr, type) and issubclass(attr, ToolModule) and attr is not ToolModule ): self._modules.append(attr())