> For the complete documentation index, see [llms.txt](https://docs.tryorchard.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tryorchard.dev/mcp/tools.md).

# Tools

Every device tool takes a `selector` (uuid / uuid-prefix / name / tag), the same as the SDK and CLI.

## Discovery

| tool                    | does                                                                   |
| ----------------------- | ---------------------------------------------------------------------- |
| `list_sandboxes`        | List reachable devices (name, uuid, platform, state, tag). Start here. |
| `get_sandbox(selector)` | Full detail of one device.                                             |

## Lifecycle

| tool                      | does           |
| ------------------------- | -------------- |
| `start_sandbox(selector)` | Boot a device. |
| `stop_sandbox(selector)`  | Stop a device. |

## Input

| tool                                                                               | does                                                                     |
| ---------------------------------------------------------------------------------- | ------------------------------------------------------------------------ |
| `tap(selector, x, y)`                                                              | Tap at pixel `(x, y)`.                                                   |
| `swipe(selector, x1, y1, x2, y2, ms=300)`                                          | Drag / scroll.                                                           |
| `key(selector, name)`                                                              | Press `home`/`back`/`recents`/`power`/`volup`/`voldown`/`enter`/….       |
| `type_text(selector, text)`                                                        | Type into the focused field.                                             |
| `tap_text(selector, text)`                                                         | Find an element by its label and tap it.                                 |
| `launch_app(selector, package)`                                                    | Launch by package id (Android) / bundle id (iOS).                        |
| `launch_intent(selector, package, component, action=None, data=None, extras=None)` | Start an exported activity component (Android). Refused if not exported. |

## See the screen

| tool                                        | does                                                                                 |
| ------------------------------------------- | ------------------------------------------------------------------------------------ |
| `screenshot(selector)`                      | Capture the screen as an image. The agent reads coordinates straight off it.         |
| `logs_tail(selector, lines=50, timeout=10)` | Recent device log lines (bounded by `timeout`, so it never hangs on a quiet device). |

## Apps

| tool                               | does                                                           |
| ---------------------------------- | -------------------------------------------------------------- |
| `list_apps(selector)`              | Installed apps/packages.                                       |
| `install_app(selector, path)`      | Install an `.apk`/`.ipa` from a local path on the server host. |
| `uninstall_app(selector, package)` | Uninstall by package id.                                       |

## Files

| tool                                           | does                                         |
| ---------------------------------------------- | -------------------------------------------- |
| `push_file(selector, local_path, dest_dir)`    | Upload a local file into a device directory. |
| `pull_file(selector, remote_path, local_path)` | Download a device file to a local path.      |

## Frida

| tool                                                 | does                                                     |
| ---------------------------------------------------- | -------------------------------------------------------- |
| `frida_status(selector)`                             | Report frida-server state.                               |
| `frida_install(selector)`                            | Install frida-server and start it. Slow.                 |
| `frida_start(selector)` / `frida_stop(selector)`     | Start or stop frida-server.                              |
| `frida_verify(selector, process=None)`               | Attach and trace a process to prove frida works.         |
| `frida_inject(selector, script, process, timeout=6)` | Run a frida script, return its `messages`. Android only. |

`frida_inject` returns once, after the run. For a live message stream, use the SDK `frida.stream` or the CLI `orchard frida stream`.

## Debugger and kernel

| tool                                     | does                                                                                                                                      |
| ---------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| `debugger_status(selector)`              | Report the on-device lldb-server state.                                                                                                   |
| `debugger_install(selector)`             | Push lldb-server to the device (needs root) and start it.                                                                                 |
| `debugger_start(selector, process=None)` | Start lldb-server, optionally attached to a process.                                                                                      |
| `gdb_bridge(selector, port=0)`           | Open a local bridge to a `cuttlefish-debug-kernel` sandbox's guest-kernel gdb stub; returns the port for `gdb vmlinux` + `target remote`. |

The lldb console and kernel gdb are interactive, so drive them from the CLI (`orchard debugger console`, `orchard gdb`) or the SDK. These need a rootable image: `cuttlefish-debug` for lldb, `cuttlefish-debug-kernel` for the kernel gdb stub. See [Debugging a device, userland to kernel](https://github.com/TheFlash2k/orchard/tree/main/docs/DEBUGGING.md).

## Live screen (WebRTC)

| tool                      | does                                                         |
| ------------------------- | ------------------------------------------------------------ |
| `screen_webrtc(selector)` | Return the WebRTC signaling URL for a sandbox's live screen. |

WebRTC needs a browser peer, so this hands back a `ws_url` to open in a browser (the Orchard console's screen panel, or the standalone `webrtc_player.html`) rather than streaming frames to the model. For a still frame to reason over, use `screenshot`.

## Remote (cloud) sandboxes

Cloud sandboxes (e2b / daytona / modal) are addressed by their **record id or name** (`ref`), not a device selector. A provider credential must already be stored for the workspace (add one from the SDK/CLI or the console).

| tool                                                                                    | does                                                                       |
| --------------------------------------------------------------------------------------- | -------------------------------------------------------------------------- |
| `remote_list()`                                                                         | List this workspace's remote sandboxes (record id, name, provider, state). |
| `remote_create(provider, name, image="", cpu=0, memory_mb=0, region="", ttl_minutes=0)` | Create a remote sandbox; `ttl_minutes>0` auto-terminates it.               |
| `remote_get(ref)`                                                                       | Details of one remote sandbox.                                             |
| `remote_stop(ref)` / `remote_delete(ref)`                                               | Stop / terminate a remote sandbox.                                         |
| `remote_push(ref, local_path, dest=None)`                                               | Upload a local file (on this server) into the sandbox.                     |
| `remote_pull(ref, path, local_path)`                                                    | Download a file out of the sandbox to this server.                         |
| `remote_metrics(ref)`                                                                   | A live cpu/mem/uptime sample (taken inside the sandbox).                   |
| `remote_logs(ref, seconds=5.0)`                                                         | Collect up to `seconds` of the sandbox's log output.                       |

The interactive remote shell is a streaming channel, so drive it from the CLI (`orchard remote shell`) or the SDK rather than a one-shot tool. `remote_logs` is usually quiet for a sandbox with no long-running entrypoint; run a command in the shell to see its output.

## Metadata

| tool                                 | does                                                           |
| ------------------------------------ | -------------------------------------------------------------- |
| `set_tag(selector, tag, color=None)` | Set the device's tag (plus an optional `#rrggbb` chip colour). |
| `create_snapshot(selector, name)`    | Snapshot the device.                                           |
| `restore_snapshot(selector, name)`   | Restore to a named snapshot.                                   |

`install_app` and `push_file` read from the filesystem of the machine running the server; `pull_file` writes there.

Next: [workflows](/mcp/workflows.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.tryorchard.dev/mcp/tools.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
