Skip to main content
Glama
Zhuoli

macOS Tools MCP Server

by Zhuoli

network_service_details

Retrieve IP address, subnet mask, and router details for a specified macOS network service to diagnose connectivity or verify configuration.

Instructions

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
service_nameYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • Registers 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.",
    )
  • Primary handler function for the tool. Validates the service_name input, checks against available services, and delegates to the core implementation in tools.py.
    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 implementation of network_service_details. Executes the `networksetup -getinfo {service_name}` command via _run_command utility.
    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])
  • Helper function used by the handler to retrieve and parse available network services for validation.
    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
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It states 'Retrieve', implying a read-only operation, but doesn't disclose behavioral traits such as authentication needs, rate limits, error handling, or what happens if the service doesn't exist. This is a significant gap for a tool with no annotation coverage.

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 that front-loads the purpose with no wasted words. It directly states what the tool does without unnecessary elaboration, making it easy to parse quickly.

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?

Given the tool has an output schema (which covers return values), no annotations, and low complexity, the description is minimally adequate. However, it lacks context on usage, behavioral transparency, and parameter details, leaving gaps that could hinder correct tool selection and invocation.

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 schema has 0% description coverage, so the description must compensate. It implies 'service_name' is used to identify the network service, but doesn't add meaning beyond that (e.g., format, examples, or valid values). With one parameter, the baseline is 4, but the description only partially compensates for the lack of schema details.

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 clearly states the action ('Retrieve') and the resource ('interface details for a network service'), specifying what information is retrieved (IP, subnet, router). It distinguishes from sibling tools like 'network_services' by focusing on details rather than listing services, though it doesn't explicitly contrast them.

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?

No guidance is provided on when to use this tool versus alternatives. The description implies it's for retrieving details of a specific network service, but it doesn't mention prerequisites, when not to use it, or how it relates to siblings like 'network_services' (which might list services).

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

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