Skip to main content
Glama

stop-all-simulator-servers

Stops all services owned by specified simulator/emulator devices—servers, debuggers, captures, proxies—freeing ports. Pass device IDs to scope cleanup and avoid cross-agent teardown.

Instructions

Stop the services a device owns - simulator-server processes (iOS + Android), native devtools, the iOS accessibility service, TV-control daemons, Chromium CDP sessions, screen recordings, native profiler sessions, native network capture with the requests it recorded, the Android network throttle proxy (set by network-conditions), and JS-runtime debugger sessions along with the network inspectors and React profiler sessions that ride on them - freeing their spawned processes, sockets and ports. Network capture started by network-capture-start ends here too, with the requests it recorded, except in a JS runtime this call does not reach, for example after Metro restarted: this call does not connect to it again, so its JS capture keeps recording and keeps its requests, and the result does not say so. A later network-capture-stop that reaches that runtime stops the recording. Call this when the user asks to clean up or ends the session, or when a skill tells you to recycle a device's services mid-flow - not just because a task finished, since the next task reuses these services and would start cold again. To stop the network capture of one app and keep its requests, call network-capture-stop instead. PASS devices with the device ids this session used: one tool-server serves every agent, subagent and CLI call using this argent install, and an unscoped call tears down THEIR devices too. Omit devices only when a machine-wide cleanup is what you actually want. An EMPTY array stops nothing; it does not ask for the machine-wide sweep. A JS-runtime debugger session is keyed by the id you called debugger-connect with. On a Metro serving two or more devices that id can be a logicalDeviceId: connect refuses a udid or serial it cannot match to one Metro device by name, and tells you to re-target with the logicalDeviceId it returns. A scope built from list-devices ids cannot reach that session. Pass any such logicalDeviceId in devices ALONGSIDE the device id. Returns { stopped }: the URNs of the live services that were shut down; empty means nothing was still running. { unmatched }, present only when a supplied id owns no service here, lists those ids, so a typo or a device NAME passed instead of an id does not read as a clean machine. It is NOT proof the id is wrong: a Vega device you only booted and drove with the remote registers no service and lands here, as does any device this session never started anything on. { left_running } lists the URNs of live debugger sessions (and the network inspectors / React profiler sessions riding on them) whose id no device scope can name; re-call with the id after each URN's <namespace>:<port>: prefix to reap them. { aborted: true } means the request was cancelled part-way: the rest was left untouched and unmatched / left_running were not computed. Fails if the input has an unknown key (e.g. udids instead of devices); otherwise it always succeeds, and reaping nothing is a result, not a failure.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "stop-all-simulator-servers"
  }
}

Input Schema

NameRequiredDescriptionDefault
devicesNoIds of the devices THIS session used (iOS UDID / Android serial / Chromium id), to scope the teardown to.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / devices / description
      Previous value: -"Device ids (iOS UDID / Android serial / Chromium id) to scope the teardown to — pass the devices THIS session actually used. Omit only for a deliberate machine-wide cleanup: one tool-server serves every agent using this argent install, so an unscoped stop also kills devices another agent is mid-session on."New value: +"Ids of the devices THIS session used (iOS UDID / Android serial / Chromium id), to scope the teardown to."
  2. Changed2 schema fields changedv0.20.0
    • addedInput schema / additionalProperties
      Added value: +false
    • addedInput schema / properties / devices
      Added value: +{
      +  "description": "Device ids (iOS UDID / Android serial / Chromium id) to scope the teardown to — pass the devices THIS session actually used. Omit only for a deliberate machine-wide cleanup: one tool-server serves every agent using this argent install, so an unscoped stop also kills devices another agent is mid-session on.",
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
  3. First observedv0.15.0

TDQS

A4.9/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so: it discloses that spawned processes, sockets and ports are freed, that the tool-server is shared across all agents/subagents so an unscoped call tears down other sessions' devices, and that an empty array stops nothing rather than requesting a machine-wide sweep. It also owns a real limitation — a JS runtime this call cannot reach after a Metro restart keeps recording, and "the result does not say so" — which is exactly the kind of caveat an agent could not infer.

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?

Purpose and the primary safety constraint are front-loaded, and the returns/edge-case material is warranted given there is no output schema. It is nonetheless heavy: single-sentence enumerations run very long and some clauses are hard to parse ("except in a JS runtime this call does not reach, for example after Metro restarted"), which slows an agent skimming for the call contract.

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 destructive, wide-blast-radius teardown with no annotations and no output schema, the description covers what is destroyed, the scoping hazard, the logicalDeviceId edge case, every return field (`stopped`, `unmatched`, `left_running`, `aborted`), and the single failure mode (unknown key). Nothing material for correct invocation is missing.

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

Parameters5/5

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

Schema coverage is already 100%, but the description adds substantial meaning beyond it: pass the ids THIS session used, omit only for deliberate machine-wide cleanup, empty array means no-op, and a `logicalDeviceId` must be passed ALONGSIDE the device id. That last rule is a non-obvious calling convention the schema cannot express.

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?

Opens with a specific verb+resource pair ("Stop the services a device owns") and then enumerates the concrete service classes covered: simulator-server processes, native devtools, accessibility service, TV-control daemons, CDP sessions, screen recordings, profilers, network capture, throttle proxy, and JS debugger sessions. It explicitly contrasts with the sibling network-capture-stop, so an agent can distinguish bulk teardown from single-target stop 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 Guidelines5/5

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

Gives explicit when-to-use triggers ("when the user asks to clean up or ends the session, or when a skill tells you to recycle a device's services mid-flow") and an explicit when-NOT ("not just because a task finished, since the next task reuses these services and would start cold again"). It also names the alternative for the narrower case: "To stop the network capture of one app and keep its requests, call network-capture-stop instead."

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