Skip to main content
Glama

Robot Actions — Remote Device Control

Android DevTools capture network

android_devtools_capture_network
Read-onlyIdempotent

Capture network requests made by a page running on the device over a time window via CDP. Enables the Network domain and collects request/response/loadingFinished/loadingFailed events. LIVE-WINDOW collector: only captures requests made AFTER it attaches — to capture a navigation/reload/fetch, pass triggerJs (fired inside the window) rather than triggering it from a separate tool call (which races the attach and returns 0 records). Returns { records, bodiesOmitted? } in summary format, or a HAR 1.2 document when format="har". Each record: { requestId, method, url, requestHeaders?, status?, statusText?, mimeType?, resourceType?, responseHeaders?, encodedDataLength?, state, errorText?, startTimestamp?, endTimestamp?, body?, bodyTruncated?, bodyError? }. Set includeBodies=true to fetch response bodies for completed text-like responses (json|text|xml|javascript|html|css|svg|x-www-form-urlencoded); per-body cap: 10 000 chars (bodyTruncated=true when hit); total cap: 200 000 chars (excess records counted in bodiesOmitted). Body fetch failures set bodyError on that record. Set throttle to emulate network conditions for the capture window only (cleared in a finally block): slow-3g (latency 2000ms, 400kbps down/up), fast-3g (latency 563ms, 1.6Mbps down / 750kbps up), offline. When throttle was active, a top-level throttle field appears in the output. Set blockUrls (URL patterns) to block matching requests, or extraHeaders to inject request headers (e.g. Authorization), for the capture window only — both cleared afterward. Returns at most limit records (default 100, most-recent first) so heavy pages stay within the token budget — filter with urlSubstring / onlyErrors; total/returned appear when records were dropped. Default window: 5 000 ms. Maximum: 30 000 ms. Omit pageId to auto-select the visible/active page.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
udidYesDevice serial number (UDID)
limitNoMax records to return, most-recent first (default 100). Heavy pages make hundreds of requests; the default keeps the response within the MCP token budget. total/returned are included when records were dropped.
formatNoOutput format: "summary" (default) returns { records, bodiesOmitted? }; "har" returns a HAR 1.2 document
pageIdNoTarget page id (auto-picked when omitted)
socketNoAbstract unix socket name (default: chrome_devtools_remote)
throttleNoEmulate network conditions for the capture window only (cleared in a finally block). slow-3g: latency 2000ms, 400kbps down/up. fast-3g: latency 563ms, 1.6Mbps down / 750kbps up. offline: no connectivity.
blockUrlsNoBlock requests whose URL matches any of these patterns (wildcards allowed, e.g. "*.doubleclick.net", "*/analytics*") for the capture window ONLY (cleared afterward). Blocked requests surface as failed. Use to capture without third-party/analytics noise.
triggerJsNoJavaScript run INSIDE the capture window (right after the collector attaches) so the requests it triggers are captured race-free — e.g. "location.reload()", "location.href='https://example.com'", or "fetch('/api/x')". Prefer this over navigating/reloading from a separate tool call, which races the collector attach and yields 0 records.
durationMsNoCollection window in milliseconds (default: 5000, max: 30000)
onlyErrorsNoOnly failed / 5xx records
extraHeadersNoExtra HTTP headers added to every request for the capture window ONLY (cleared afterward), e.g. { "Authorization": "Bearer …" } to capture authenticated requests. These are session-scoped, which is why they apply only during this capture.
urlSubstringNoOnly records whose URL contains this substring — target the requests you care about
includeBodiesNoFetch response body for completed text-like responses (default: true). Request bodies (postData) are always captured. Set false to skip response bodies for a lighter payload. Per-body cap: 10 000 chars. Total cap: 200 000 chars.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.5/5.0
Behavior5/5

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

Annotations already declare readOnly/idempotent/non-destructive, and the description adds substantial context beyond them: the live-window attach semantics, that throttle/blockUrls/extraHeaders are cleared in a finally block and scoped to the capture window only, per-body (10 000) and total (200 000) body caps with bodiesOmitted/bodyTruncated/bodyError signals, and the default/max window bounds.

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?

Front-loaded with purpose and the critical live-window caveat, then return shape, then options. It is dense and long, but justified by 13 parameters and no output schema; a few clauses (e.g. re-listing throttle profiles already in the schema) are redundant.

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?

With no output schema, the description fully documents the return contract: the { records, bodiesOmitted? } summary shape, the HAR 1.2 alternative, every record field, and the throttle/total/returned extras. Nothing an agent needs to call this correctly is missing.

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 the baseline is 3, but the description adds cross-parameter interaction context not present in the schema — how limit interacts with urlSubstring/onlyErrors and the token budget, that total/returned appear only when records were dropped, and that a top-level throttle field surfaces when throttling was active.

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 ('Capture network requests made by a page running on the device ... via CDP') plus the mechanism (CDP Network domain, event set), so it is clearly distinct from native-traffic tools like android_traffic_* and from sibling DevTools tools. It never explicitly names an alternative or says when-not to use it, so it falls short of full sibling differentiation.

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?

Explicit when/when-not guidance: pass triggerJs rather than triggering navigation from a separate tool call because the latter 'races the attach and returns 0 records'; use urlSubstring/onlyErrors to keep heavy pages within the token budget; omit pageId to auto-select the visible page; set includeBodies/throttle/blockUrls/extraHeaders only when needed for the window.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources