Skip to main content
Glama

network_service_details

Retrieve IP address, subnet mask, and router information for specific macOS network services to diagnose connectivity issues and verify network configuration.

Instructions

Retrieve interface details (IP, subnet, router) for a network service.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
service_nameYes

Implementation Reference

  • The FastMCP tool handler for network_service_details, which validates the input service name against available network services and delegates to the tools module implementation.
    def network_service_details(service_name: str, _: Context | None = None) -> str: service = service_name.strip() if not service: raise ToolError("Provide the name of a network service to inspect") available = set(tools.available_network_services()) if available and service not in available: raise ToolError( "Unknown network service. Choose one of: " + ", ".join(sorted(available)) ) return tools.network_service_details(service)
  • Core helper function that executes the 'networksetup -getinfo' command to retrieve the network service details.
    def network_service_details(service_name: str) -> str: """Return interface details for a given network service.""" if not service_name.strip(): raise ToolError("Network service name must not be empty") return _run_command(["networksetup", "-getinfo", service_name])
  • Registration of the network_service_details tool with FastMCP @app.tool decorator, specifying name and description.
    @app.tool( name="network_service_details", description="Retrieve interface details (IP, subnet, router) for a network service.", )
  • Helper function that parses output from network_services() to yield clean list of available network service names, used for validation in the tool handler.
    def available_network_services() -> Iterable[str]: """Helper that returns the list of network services, skipping blank lines.""" output = network_services() for line in output.splitlines(): line = line.strip() if not line or line.startswith("An asterisk"): continue sanitized = line.lstrip('* ').strip() if sanitized: yield sanitized

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/Zhuoli/mcp101'

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