Skip to main content
Glama

Robot Actions — Remote Device Control

Android traffic mock add

android_traffic_mock_add

Add (or update in place, if id matches an existing route) a mock/abort rule that short-circuits future matching HTTPS requests on this device inside the TLS-inspecting proxy — the request never reaches the real server. mode "mock" (default) returns the given status/headers/body; mode "abort" kills the connection so the app sees a network failure. Requires TLS capture to already be running on this device (android_traffic_start) — routes are stored per-device and take effect live, no restart needed. Certificate-pinned apps cannot be intercepted at all (same limit as capture itself), so a route targeting pinned traffic will simply never match.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idNoRoute id to update in place (replaces the existing route); omit to auto-generate a new one
bodyNoResponse body to inject for mode "mock" (text, or base64 when bodyEncoding is "base64")
modeNo"mock" injects a canned response (default); "abort" kills the connection
methodNoOptional HTTP method filter (e.g. "GET"/"POST"); matches any method when omitted
serialYesAndroid device serial (adb serial)
statusNoHTTP status to inject for mode "mock" (default 200)
delayMsNoLatency to inject before responding/aborting, in ms (clamped to 60s server-side)
enabledNoWhether the route is active (default true) — disabled routes are kept but ignored
headersNoResponse headers to inject for mode "mock", as {headerName: value} — e.g. {"content-type": "application/json"}
matchUrlYesURL pattern to match against the request's full URL
matchTypeNoHow matchUrl is interpreted against the request URL (default "contains")
bodyEncodingNoEncoding of `body` (default "text")

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.5/5.0
Behavior5/5

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

With annotations only covering safety flags, the description carries real behavioral weight: per-device storage, live effect with no restart, mock-vs-abort outcome (canned response vs killed connection), and the certificate-pinning limitation. The 'update in place if id matches' semantics are consistent with idempotentHint=false.

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?

Dense and front-loaded, leading with the verb and the update-in-place caveat. Every clause carries information (prerequisite, live effect, pinning limit), though the multi-clause sentence is heavy and could be split for readability.

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

Completeness4/5

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

For a 12-parameter mutation tool with no output schema, the description covers purpose, prerequisites, live behavior, and limitations well. The one gap is that it never says what is returned (e.g. the generated route id), which matters for follow-up calls to mock_list/mock_remove.

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 coverage is 100%, so the baseline is 3, but the description adds meaning beyond the schema for key parameters: it explains mode 'mock' vs 'abort' behavior and the id-driven update-in-place path. Other params (headers, delayMs, matchType) are left to 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?

States a specific verb+resource (add/update a mock or abort route) and precisely scopes it to the TLS-inspecting proxy on this device, distinguishing it from sibling tools like android_traffic_mock_list/remove and android_traffic_start. It even clarifies the update-in-place semantics when `id` matches.

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?

Gives a clear precondition (TLS capture must already be running via android_traffic_start) and an explicit exclusion (certificate-pinned apps can never be intercepted, so such routes never match). It does not name sibling alternatives (e.g. android_devtools_mock_add, webpage_mock_add) for the non-Android case, so it stops short of full when/when-not routing.

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