Skip to main content
Glama
RFingAdam

EMC Regulations MCP Server

by RFingAdam

cispr_limit

Retrieve CISPR emission limits for radiated or conducted emissions by specifying frequency, standard, device class, and emission type.

Instructions

Get CISPR emission limits (CISPR 11, 22, 32, 14-1). Returns radiated or conducted limits for Class A or B.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
frequency_mhzYesFrequency in MHz
standardYesCISPR standard
device_classNoDevice class
emission_typeNoEmission type

Implementation Reference

  • Tool handler dispatcher - routes 'cispr_limit' calls to get_cispr_limit()
    async def call_tool(self, name: str, arguments: dict[str, Any]) -> list[TextContent]:
        if name == "cispr_limit":
            freq_mhz = arguments["frequency_mhz"]
            standard = arguments["standard"]
            device_class = arguments.get("device_class", "B")
            emission_type = arguments.get("emission_type", "radiated")
    
            result = get_cispr_limit(standard, device_class, freq_mhz, emission_type)
            return [TextContent(type="text", text=result)]
  • Core handler function - looks up CISPR limits from JSON data and returns formatted result
    def get_cispr_limit(standard: str, device_class: str, freq_mhz: float, emission_type: str = "radiated") -> str:
        """Get CISPR emission limit as a formatted string."""
        standard = standard.lower()
        device_class = device_class.lower()
    
        if "32" in standard or "22" in standard:
            data = CISPR_LIMITS.get("cispr_32", {})
        elif "11" in standard:
            data = CISPR_LIMITS.get("cispr_11", {})
        elif "14" in standard:
            data = CISPR_LIMITS.get("cispr_14_1", {})
        else:
            return f"Unknown CISPR standard: {standard}"
    
        class_key = f"class_{device_class}" if device_class in ["a", "b"] else "class_b"
        class_data = data.get(class_key, data.get("group_1", {}).get(class_key, {}))
    
        if not class_data:
            return f"No data for {standard} Class {device_class.upper()}"
    
        result = f"CISPR {standard.upper()} Class {device_class.upper()} at {freq_mhz} MHz\n{'=' * 50}\n\n"
    
        if emission_type == "radiated":
            rad_data = class_data.get("radiated_emissions", {})
            limits = rad_data.get("limits", [])
            limit = find_limit_for_frequency(limits, freq_mhz)
    
            if limit:
                result += f"Radiated Emissions (@ {rad_data.get('measurement_distance_m', '?')}m):\n"
                result += format_limit_result(limit)
            else:
                above_1g = rad_data.get("above_1ghz", {})
                if above_1g and freq_mhz >= 1000:
                    limits = above_1g.get("limits", [])
                    limit = find_limit_for_frequency(limits, freq_mhz)
                    if limit:
                        result += f"Radiated Emissions >1GHz (@ {above_1g.get('measurement_distance_m', '?')}m):\n"
                        result += format_limit_result(limit)
                if not limit:
                    result += "No radiated limit found for this frequency"
        else:
            cond_data = class_data.get("conducted_emissions", {})
            limits = cond_data.get("limits", [])
            limit = find_limit_for_frequency(limits, freq_mhz)
    
            if limit:
                result += f"Conducted Emissions ({cond_data.get('port', 'AC mains')}):\n"
                result += format_limit_result(limit)
            else:
                result += "No conducted limit found for this frequency"
    
        return result
  • Tool schema/registration - defines name, description, and input schema for the cispr_limit tool
    Tool(
        name="cispr_limit",
        description="Get CISPR emission limits (CISPR 11, 22, 32, 14-1). Returns radiated or conducted limits for Class A or B.",
        inputSchema={
            "type": "object",
            "properties": {
                "frequency_mhz": {"type": "number", "description": "Frequency in MHz"},
                "standard": {"type": "string", "enum": ["CISPR 11", "CISPR 22", "CISPR 32", "CISPR 14-1"], "description": "CISPR standard"},
                "device_class": {"type": "string", "enum": ["A", "B"], "description": "Device class"},
                "emission_type": {"type": "string", "enum": ["radiated", "conducted"], "description": "Emission type"},
            },
            "required": ["frequency_mhz", "standard"],
        },
    ),
  • Auto-discovery registers all ToolModule subclasses; CISPRTools is discovered via pkgutil and registered automatically
    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())
  • Helper used by get_cispr_limit to format limit entries for display
    def format_limit_result(limit: dict, section: str = "") -> str:
        """Format a single limit entry for human-readable display."""
        freq_range = f"{limit.get('freq_min_mhz', '?')} - {limit.get('freq_max_mhz', '?')} MHz"
    
        if "limit_dbuv_m" in limit:
            value = f"{limit['limit_dbuv_m']} dBuV/m"
        elif "limit_uv_m" in limit:
            value = f"{limit['limit_uv_m']} uV/m ({limit.get('limit_dbuv_m', '?')} dBuV/m)"
        elif "limit_dbuv" in limit:
            value = f"{limit['limit_dbuv']} dBuV"
        elif "limit_dbuv_qp" in limit:
            value = f"QP: {limit['limit_dbuv_qp']} dBuV/m, Avg: {limit.get('limit_dbuv_avg', '?')} dBuV/m"
        else:
            value = "See notes"
    
        distance = f"@ {limit['distance_m']}m" if "distance_m" in limit else ""
        detector = f"({limit['detector']})" if "detector" in limit else ""
        notes = f" - {limit['notes']}" if "notes" in limit else ""
    
        return f"  {freq_range}: {value} {distance} {detector}{notes}"
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are present, so the description carries full responsibility. It indicates a read operation (get) with no side effects, but does not disclose authentication needs, rate limits, or other behavioral traits. Basic but not rich.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, information-dense sentence with no extraneous words. It is front-loaded with the main action and details in a compact format.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple lookup tool with no output schema, the description appropriately captures purpose, inputs (via schema), and output type. It could mention return units or error handling for out-of-range frequency, but remains largely complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% with adequate descriptions. The tool description adds context about the return (radiated/conducted limits for classes) but does not explain parameter syntax or constraints beyond what the schema provides. Baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it retrieves CISPR emission limits, names the specific standards (CISPR 11, 22, 32, 14-1), and specifies the return includes radiated or conducted limits for Class A or B. This distinguishes it from sibling tools like cispr12_limit which cover other standards.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for CISPR limits but does not explicitly state when to use this tool versus alternatives such as cispr12_limit, fcc_part15_limit, or emc_compare_limits. No exclusions or contextual guidance is provided.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/RFingAdam/mcp-emc-regulations'

If you have feedback or need assistance with the MCP directory API, please join our Discord server