Skip to main content
Glama
sealablab

Moku MCP Server

by sealablab

discover_mokus

Find Moku devices on your network using zeroconf discovery to enable LLM control and configuration management.

Instructions

Discover Moku devices on network via zeroconf

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
timeoutNoDiscovery timeout in seconds (default: 2)

Implementation Reference

  • The implementation of the discover_mokus handler, which uses Zeroconf to find Moku devices on the network.
    async def discover_mokus(self, timeout: int = 2):
        """
        Discover Moku devices on network via zeroconf.
    
        Args:
            timeout: Discovery timeout in seconds (default: 2)
    
        Returns:
            {
                "devices": [
                    {
                        "ip": "192.168.1.100",
                        "name": "Lilo",
                        "serial": "MG106B",
                        "port": 80,
                        "last_seen": "2025-10-25T20:00:00Z"
                    }
                ],
                "count": 1
            }
    
        Implementation: See IMPLEMENTATION_GUIDE.md Section 3.1
        """
        from moku import Moku
        from .utils import update_cache_with_device
    
        discovered = []
        zc = Zeroconf()
    
        def on_service_change(zeroconf, service_type, name, state_change):
            """Handle zeroconf service discovery events."""
            if state_change == ServiceStateChange.Added:
                info = zeroconf.get_service_info(service_type, name)
                if info:
                    # Extract IPv4 address
                    addresses = info.parsed_addresses()
                    ipv4 = [addr for addr in addresses if ":" not in addr]
                    ip = ipv4[0] if ipv4 else addresses[0] if addresses else None
    
                    if ip:
                        device = MokuDeviceInfo(
                            ip=ip,
                            port=info.port if info.port else 80,
                            zeroconf_name=name,
                            last_seen=datetime.now(timezone.utc).isoformat(),
                        )
                        discovered.append(device)
                        logger.info(f"Discovered device at {ip}:{info.port}")
    
        # Start discovery
        browser = ServiceBrowser(zc, "_moku._tcp.local.", handlers=[on_service_change])
    
        # Wait for discovery
        await asyncio.sleep(timeout)
    
        # Close zeroconf
        zc.close()
    
        # Enrich with metadata (name, serial) via Moku API
        for device in discovered:
  • The registration of the discover_mokus tool definition.
    Tool(
        name="discover_mokus",
        description="Discover Moku devices on network via zeroconf",
        inputSchema={
            "type": "object",
            "properties": {
                "timeout": {
                    "type": "number",
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions 'zeroconf' indicating network broadcast behavior but fails to disclose what the tool returns (a list of devices?), whether it blocks for the full timeout duration, or that it generates network traffic. Critical behavioral context for a network discovery tool is missing.

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, efficient sentence with six words. It front-loads the action ('Discover') and contains zero waste. Every word earns its place by conveying the operation, target, and method.

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

Completeness3/5

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

For a tool with one optional parameter and no output schema, the description adequately explains the operation but leaves a significant gap regarding return values. Since no output schema exists to document what 'discover' returns (likely device identifiers/IPs), the description should mention this to be 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?

The input schema has 100% description coverage ('Discovery timeout in seconds'), so the schema already fully documents the parameter. The description adds no additional parameter context, but given the high schema coverage, the baseline score of 3 is appropriate as no compensation is needed.

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

Purpose4/5

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

The description uses a specific verb ('Discover') and resource ('Moku devices'), and specifies the mechanism ('via zeroconf'). It implicitly distinguishes from sibling tools like 'attach_moku' and 'push_config' by describing a read-only discovery operation versus state-changing actions, though it could explicitly state this is the first step before attaching.

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

Usage Guidelines2/5

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

The description states what the tool does but provides no guidance on when to use it versus alternatives. It does not mention that this should be used before 'attach_moku' to find available devices, nor does it specify prerequisites like network access or when to adjust the timeout parameter.

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/sealablab/moku-mcp'

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