Skip to main content
Glama

Reverse a device port to the host

reverse_port
Idempotent

Create an ADB reverse socket connection to let device-side apps or scripts reach a server running on your host machine.

Instructions

Create a reverse socket connection (adb reverse): the device listens on the remote spec and connections are forwarded to the local spec on the host machine. Use it to let device-side code (app under test, on-device scripts) reach a server running on your machine.

Input Schema

NameRequiredDescriptionDefault
localYesHost-side target spec, e.g. "tcp:8080".
deviceNoDevice serial from list_devices; optional when exactly one device is connected.
remoteYesDevice-side listen spec, e.g. "tcp:8080".
no_rebindNoPass --no-rebind to fail instead of replacing an existing reverse (default false).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.6.0

TDQS

A4.2/5.0
Behavior3/5

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

Annotations already declare the safety profile (readOnlyHint=false, destructiveHint=false, idempotentHint=true), so the description only needs to add context beyond them. It does add the forwarding direction semantics, but says nothing about lifecycle: whether the reverse persists beyond the session, or that the default behavior replaces an existing reverse when the spec differs (the no_rebind parameter implies rebinding, which is left to the schema).

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?

Two sentences, zero waste, with the directionality semantics front-loaded before the use case. Nothing repeats the title or schema verbatim.

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

Completeness4/5

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

For a 4-param mutation tool with full schema coverage, annotations, and no output schema, this covers what an agent needs to call it correctly. The only omissions are peripheral: the rebind/replace default and the existence of remove_reverse as the teardown counterpart.

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?

Schema description coverage is 100%, so baseline is 3. The description still earns above baseline by explaining that 'remote' is the device-side listening spec and 'local' is the host-side target, which resolves the naming ambiguity that the terse schema descriptions ('Device-side listen spec') only partly cover.

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?

Names a specific verb+resource ('Create a reverse socket connection (`adb reverse`)') and disambiguates the exact point that confuses agents versus forward_port: which side listens and which side connects. An agent can distinguish it from 'forward_port' without opening either schema.

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

Usage Guidelines4/5

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

Gives a concrete when-to-use ('let device-side code ... reach a server running on your machine'), which is the canonical scenario. It stops short of naming the sibling alternative forward_port for the opposite direction or pointing at remove_reverse for teardown, so it doesn't reach explicit when-not/alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.