Skip to main content
Glama

ADB reverse

adb_reverse
Idempotent

Forwards a device TCP port to a host port so an emulator or device can reach a local dev server such as Metro, preventing silent fallback to the embedded bundle.

Instructions

Forward a DEVICE TCP port to a HOST port (adb reverse) so the emulator/device can reach a server on this machine — the canonical use is tcp:8081 for Metro. CRITICAL for RN/Expo dev clients: if the app can't reach its dev server it may SILENTLY fall back to the embedded bundle and ignore every code edit you make — set this up before a dev-client session, and suspect it whenever edits seem to have no effect (app_state confirms whether the running process is on Metro or the embedded bundle). remove=true undoes the forward.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "device_port": "<device_port>"
    },
    "name": "adb_reverse"
  }
}

Input Schema

NameRequiredDescriptionDefault
removeNoRemove the forward for device_port instead of creating it.
serialNoTarget device serial (adb -s). Optional when exactly one device is attached.
host_portNoTCP port on the HOST to forward to. Defaults to device_port.
device_portYesTCP port on the DEVICE to forward, e.g. 8081 for Metro.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.4/5.0
Behavior5/5

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

Annotations already declare idempotentHint=true, destructiveHint=false, and openWorldHint=false. The description adds important behavior beyond that: the silent fallback to the embedded bundle, why this matters before a dev-client session, and how app_state can confirm whether Metro is actually in use.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The purpose is front-loaded and the critical fallback warning is useful context. The long CRITICAL sentence is somewhat verbose, but the overall structure remains clear and each part serves the agent.

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?

For a four-parameter tool with no output schema, it covers purpose, usage timing, failure mode, removal behavior, and the app_state diagnostic path. The input schema covers all parameters, so no critical calling context is missing.

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?

Schema coverage is 100% and already documents device_port with the 8081/Metro example, host_port defaulting to device_port, serial, and remove. The description reinforces the Metro example and remove=true undo behavior, but adds little meaning beyond the schema.

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?

It states a specific verb and resource: 'Forward a DEVICE TCP port to a HOST port (adb reverse)' and gives the canonical Metro use. This makes clear it is the port-forwarding tool rather than launch/reload/app_state siblings.

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?

It gives explicit timing: set this up before a dev-client session and suspect it whenever edits seem to have no effect. It also says remove=true undoes the forward, though it does not name sibling alternatives or state broader when-not-to-use conditions.

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