Skip to main content
Glama

Robot Actions — Remote Device Control

iOS Safari heap snapshot

ios_safari_heap_snapshot
Idempotent

Take a JavaScript heap snapshot of a Safari page on an iOS device and write it to a file on the RDS host, returning { nodeCount, edgeCount, bytes, path }. The file is a V8-format .heapsnapshot that loads directly in Chrome DevTools → Memory → "Load profile", so it can be handed to a human to open. Snapshots are multi-MB, which is why the content is never returned inline. Use it to find what a page is retaining: take one, exercise the leak, take another, and compare nodeCount/edgeCount — a count that climbs and never comes back down across repetitions of the same interaction is the signal. Garbage is collected first by default so unreachable objects do not read as a leak; pass collectGarbage=false only when you deliberately want to measure uncollected garbage. Omit pageId to use the active tab. Requires Web Inspector enabled: Settings → Safari → Advanced → Web Inspector.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
udidYesiOS device UDID
pageIdNoTarget page id from ios_safari_list_pages (default: active tab)
collectGarbageNoRun garbage collection before snapshotting (default: true)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.8/5.0
Behavior5/5

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

Annotations (readOnlyHint=false, idempotentHint=true, destructiveHint=false) cover the safety profile, and the description adds substantial context beyond them: the return shape, that multi-MB content is never returned inline, that GC runs first by default and why, and the Web Inspector prerequisite. No contradiction with annotations.

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 core action and return value are front-loaded, and every sentence carries information. It is on the longer side, but the extra sentences (workflow, GC caveat, prerequisite) earn their place rather than padding.

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 compensates by spelling out the returned fields and the on-disk artifact. Combined with the prerequisite and workflow guidance, an agent has everything needed to call and interpret this tool correctly.

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 real meaning for collectGarbage ('pass collectGarbage=false only when you deliberately want to measure uncollected garbage') and confirms pageId omission semantics. This goes beyond the schema's terse parameter docs.

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 and resource ('Take a JavaScript heap snapshot of a Safari page on an iOS device') plus the side effect (writes a V8 .heapsnapshot file to the RDS host). This clearly distinguishes it from siblings like ios_safari_trace or ios_performance_snapshot.

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 an explicit workflow: 'take one, exercise the leak, take another, and compare nodeCount/edgeCount — a count that climbs and never comes back down... is the signal.' It also names the condition that flips the collectGarbage default and references ios_safari_list_pages for pageId.

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