Skip to main content
Glama

adb_forward

Forward a local host port to a port on an Android device to connect to services running on the device. Use it when you need host-to-device port mapping for debugging or service access.

Instructions

Forward a local port to a port on the device (host → device). Use for connecting to services running on the device.

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": {
      "local": "<local>",
      "remote": "<remote>"
    },
    "name": "adb_forward"
  }
}

Input Schema

NameRequiredDescriptionDefault
localYesLocal (host) spec, e.g., 'tcp:8080'. AF2 fix: format-validated.
deviceNoDevice serial
remoteYesRemote (device) spec, e.g., 'tcp:8080' or 'localabstract:app_socket'. AF2 fix: format-validated.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.1.6
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
  2. Changed5 schema fields changedv1.1.3
    • removedInput schema / additionalProperties
      Removed value: -false
    • changedInput schema / properties / local / description
      Previous value: -"Local (host) spec, e.g., 'tcp:8080'"New value: +"Local (host) spec, e.g., 'tcp:8080'. AF2 fix: format-validated."
    • addedInput schema / properties / local / pattern
      Added value: +"^(tcp:\\d{1,5}|localabstract:[A-Za-z0-9_./-]+|localreserved:[A-Za-z0-9_./-]+|localfilesystem:[A-Za-z0-9_./-]+|dev:[A-Za-z0-9_./-]+|jdwp:\\d+)$"
    • changedInput schema / properties / remote / description
      Previous value: -"Remote (device) spec, e.g., 'tcp:8080' or 'localabstract:app_socket'"New value: +"Remote (device) spec, e.g., 'tcp:8080' or 'localabstract:app_socket'. AF2 fix: format-validated."
    • addedInput schema / properties / remote / pattern
      Added value: +"^(tcp:\\d{1,5}|localabstract:[A-Za-z0-9_./-]+|localreserved:[A-Za-z0-9_./-]+|localfilesystem:[A-Za-z0-9_./-]+|dev:[A-Za-z0-9_./-]+|jdwp:\\d+)$"
  3. First observedv1.1.1

TDQS

B3.2/5.0
Behavior2/5

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

No annotations are supplied, so the description carries the full behavioral burden. It does not say whether the forward persists across adb disconnects, what happens if the local port is already claimed, whether the call errors or overwrites, or that a forwarding rule is being created that must be cleaned up with adb_forward_remove.

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?

Two short sentences with the action and direction front-loaded; nothing is padded. The second sentence is mildly redundant with the first but does add the practical use case.

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

Completeness3/5

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

For a three-parameter mutation tool with no annotations and no output schema, the description is minimally adequate. It omits lifecycle details an agent needs — persistence of the rule, error behavior on port conflicts, and the existence of adb_forward_remove for teardown.

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 description coverage is 100%, so the baseline is 3. The '(host → device)' note usefully reinforces that 'local' is the host spec and 'remote' is the device spec, but that mapping is already stated in the individual property descriptions, so the added meaning is marginal.

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

Purpose4/5

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

States a specific verb and resource ('Forward a local port to a port on the device') and pins the direction with '(host → device)'. That direction marker implicitly separates it from adb_reverse and the adb_forward_list/remove siblings, though none are named explicitly.

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

Usage Guidelines3/5

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

'Use for connecting to services running on the device' gives a positive use case, but there is no guidance on when to prefer this over adb_reverse, adb_tunnel_open, or adb_forward_list, and no mention that adb_forward_remove is needed afterwards.

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

Deploy Server

Other Tools