Skip to main content
Glama
rahulkr
by rahulkr

get_network_info

Retrieve network connectivity details from Android devices to diagnose connection issues and verify network status during development and testing.

Instructions

Get network connectivity information

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
device_serialNo

Implementation Reference

  • The handler function implementing the 'get_network_info' tool. Decorated with @mcp.tool() for automatic registration in the MCP server. Retrieves WiFi status and IP address via ADB shell commands (dumpsys wifi and ip addr), parses the output, and returns a dictionary with wifi_enabled, connected, and optionally ip_address.
    @mcp.tool()
    def get_network_info(device_serial: str | None = None) -> dict:
        """Get network connectivity information"""
        wifi = run_adb(["shell", "dumpsys", "wifi"], device_serial)
        
        info = {
            "wifi_enabled": "Wi-Fi is enabled" in wifi,
            "connected": "CONNECTED" in wifi
        }
        
        # Get IP address
        ip_output = run_adb(["shell", "ip", "addr", "show", "wlan0"], device_serial)
        ip_match = re.search(r'inet (\d+\.\d+\.\d+\.\d+)', ip_output)
        if ip_match:
            info['ip_address'] = ip_match.group(1)
        
        return info
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 states the tool retrieves information (implying a read-only operation), but doesn't specify if it requires device permissions, has side effects (e.g., network scans), rate limits, or error handling. For a tool with zero annotation coverage, this lack of detail is a significant gap in transparency.

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 extremely concise with a single sentence ('Get network connectivity information'), which is front-loaded and wastes no words. It efficiently conveys the core purpose 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.

Completeness2/5

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

Given the tool's complexity (a read operation with one parameter), lack of annotations, no output schema, and low schema description coverage, the description is incomplete. It doesn't cover behavioral aspects, parameter details, or return values, leaving the agent with insufficient information for reliable tool invocation in a context with many sibling tools.

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

Parameters2/5

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

The input schema has one parameter ('device_serial') with 0% description coverage, and the tool description adds no parameter semantics. It doesn't explain what 'device_serial' is (e.g., a unique identifier for targeting a specific device), its format, or when it's required (default is null). With low schema coverage, the description fails to compensate, leaving the parameter poorly documented.

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

Purpose3/5

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

The description 'Get network connectivity information' clearly states the tool's purpose with a verb ('Get') and resource ('network connectivity information'), making it understandable. However, it's somewhat vague about what specific information is retrieved (e.g., Wi-Fi status, IP address, signal strength) and doesn't differentiate from sibling tools like 'get_device_info' or 'toggle_wifi', which might overlap in network-related contexts.

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 provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., device connectivity), exclusions, or comparisons to sibling tools like 'get_device_info' (which might include network data) or 'toggle_wifi' (which controls network state). This leaves the agent with minimal context for tool selection.

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/rahulkr/r_adb_mcp_server'

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