Skip to main content
Glama

Robot Actions — Remote Device Control

ios_safari_mock_add

Add (or update in place, when id matches an existing route) a mock/abort rule for Safari/WKWebView requests on this device. mode "mock" (default) serves the given status/headers/body without the request leaving the device; mode "abort" fails it so the page sees a network error. Routes apply immediately and survive navigation. WEB CONTENT ONLY: this intercepts requests made by browser/WebView pages. Requests made by native app code are NOT intercepted and never will be by this tool. Nothing device-wide is changed and no certificate is installed — the effect is scoped to the page. For requests made by native app code use ios_traffic_mock_add instead.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idNoRoute id to update in place; omit to auto-generate a new one
bodyNoResponse body for mode "mock" (text, or base64 when bodyEncoding is "base64")
modeNo"mock" serves a canned response (default); "abort" fails the request
udidYesDevice id (Android serial or iOS UDID)
methodNoOptional HTTP method filter (e.g. "GET"/"POST"); matches any method when omitted
pageIdNoPin routing to a specific page id (from the *_list_pages tool). Omit to follow the active page automatically across navigations and new tabs — recommended.
statusNoHTTP status to serve for mode "mock" (default 200)
delayMsNoLatency injected before responding/failing, in ms (clamped to 60s)
enabledNoWhether the route is active (default true) — disabled routes are kept but ignored
headersNoResponse headers for mode "mock", as {headerName: value} — e.g. {"content-type": "application/json"}. On iOS a `charset` in content-type is NOT applied to the response: an HTML body with non-ASCII characters must declare it in the document (e.g. <meta charset="utf-8">) or it will be decoded with the default encoding and render as mojibake.
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. Changed1 schema field changed
    • changedInput schema / properties / headers / description
      Previous value: -"Response headers for mode \"mock\", as {headerName: value} — e.g. {\"content-type\": \"application/json\"}"New value: +"Response headers for mode \"mock\", as {headerName: value} — e.g. {\"content-type\": \"application/json\"}. On iOS a `charset` in content-type is NOT applied to the response: an HTML body with non-ASCII characters must declare it in the document (e.g. <meta charset=\"utf-8\">) or it will be decoded with the default encoding and render as mojibake."
  2. Added

TDQS

A4.5/5.0
Behavior4/5

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

With no annotations provided, the description carries the full burden, and it does a strong job: it discloses the update-in-place semantics for matching 'id', the immediate effect, survival across navigation, and the explicit non-goal (native app interception). It also discloses the subtle iOS charset behavior in headers. It falls slightly short of a 5 only because it doesn't specify what the response looks like or address failure modes such as 'what happens if id is missing'.

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?

The description is dense but every sentence adds value: scope, modes, defaults, navigation behavior, and an explicit pointer to the sibling tool. It is somewhat long with capitalized emphasis that may be unnecessary, but it remains highly informative and well-organized, leading with the core purpose before caveats.

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 13-parameter tool with no output schema, the description covers the conceptual model, the update semantics, and the critical scope limitation, which is enough for an agent to know when and how to use it. Minor gaps remain—there is no mention of how to verify a route was added or how to remove it—but the sibling list and parameter descriptions already cover removal. Overall it is complete for selection and invocability.

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 schema already documents each parameter thoroughly. The tool description adds important semantic context beyond that: it explains 'mock' vs 'abort' behavior, clarifies the default mode, and notes that routes apply immediately and survive navigation. It also clarifies that the tool covers only WebView/browser content, which affects how matchUrl and pageId parameters are interpreted.

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?

The description begins with a specific verb ('Add (or update in place)') and clearly identifies the resource: a mock/abort rule for Safari/WKWebView requests on this device. It distinguishes itself from related tools by explicitly stating the native-scope sibling tool to use instead, and the named modes 'mock' and 'abort' precisely define the behavior.

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?

The description explicitly states when to use this tool versus alternatives, saying 'For requests made by native app code use ios_traffic_mock_add instead.' It also explains the WEB CONTENT ONLY scope, provides default behavior, and clears up that no device-wide changes or certificates are installed. This gives the agent clear selection guidance.

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