Skip to main content
Glama

Connect to a device over Wi-Fi

android_connect_wifi
Idempotent

Enable wireless adb on a USB-connected Android device, or reconnect to a known address to continue untethered debugging.

Instructions

Switch a USB-connected device to wireless adb, or reconnect to one that was paired before.

Wireless adb is what makes it practical to keep iterating on a phone that is not tethered to the machine. The device and the host must be on the same network.

Two modes:

  1. No 'host' given — requires a USB device. Reads the device's Wi-Fi address, runs 'adb tcpip', then connects. After this succeeds the USB cable can be unplugged.

  2. 'host' given — reconnects directly to a known address, no USB needed.

Args:

  • host (string, optional): device IP, with or without port, e.g. "192.168.0.12" or "192.168.0.12:5555"

  • port (number): TCP port to use (default: 5555)

  • serial (string, optional): USB serial to promote to wireless, when several devices are attached

Returns: { "serial": string, "host": string, "port": number, "alreadyConnected": boolean }

Examples:

  • Use when: you want to unplug the cable and keep building to the device

  • Use when: the wireless connection dropped after the phone slept and you need it back

  • Don't use when: you only need to know what is connected (use android_list_devices)

Error Handling:

  • "no usable IPv4 address" means the device is not on Wi-Fi; connect it to the same network as this machine

  • A device that has rebooted loses TCP/IP mode entirely and must be re-promoted over USB

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hostNoKnown device address to reconnect to. Omit to promote a USB device.
portNoTCP port for the adb connection.
serialNoDevice serial from android_list_devices. Optional when exactly one device is connected; required when several are.
Behavior5/5

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

The description discloses significant behavioral context beyond annotations: the need for same-network connectivity, the USB requirement for promotion, the fact that a rebooted device loses TCP/IP mode, and error messages. Annotations (readOnly=false, idempotent=true, destructive=false) are consistent, and the description adds meaningful details about side effects and failure modes.

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 well-structured with clear sections: purpose, modes, arguments, return value, usage examples, and error handling. Despite its length, every sentence contributes value, and the front-loaded first sentence immediately conveys the tool's purpose. The structure improves scannability and comprehension.

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

Completeness5/5

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

The description is comprehensive for a tool with no output schema. It explains return values explicitly ('Returns: { serial, host, port, alreadyConnected }'), covers both usage modes, and provides error-handling guidance. Combined with the rich schema and annotations, the agent has all necessary context to invoke the tool correctly.

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

Parameters4/5

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

Although schema description coverage is 100%, the description enriches parameter semantics with examples (e.g., '192.168.0.12' or '192.168.0.12:5555'), default port value, and the relationship between 'host' and mode selection. It adds practical meaning beyond the schema's formal definitions, so a score above baseline is warranted, though not a 5 since the schema already covers the basic meaning.

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

Purpose5/5

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

The description clearly states the tool's function: 'Switch a USB-connected device to wireless adb, or reconnect to one that was paired before.' It specifies the verb (connect/switch) and resource (device over Wi-Fi) and distinguishes itself from siblings like android_list_devices by focusing on wireless connection setup.

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

Usage Guidelines5/5

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

The description provides explicit 'Use when' and 'Don't use when' guidance, including an alternative tool: 'Don't use when: you only need to know what is connected (use android_list_devices).' It also explains the two modes (with/without host) and network prerequisites, making the tool's context of use very clear.

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/jjs03111/android-build-mcp'

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