Skip to main content
Glama

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

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