Skip to main content
Glama
carloshpdoc

memorydetective

Replay a UI scenario to amplify a suspected leak

replayScenario

Drive iOS Simulator through a sequence of UI actions to reproduce memory leaks. Repeat actions to amplify subtle leaks, and pair with state capture for deterministic debugging.

Instructions

[mg.scenario] Drive the iOS Simulator through a sequence of UI actions (tap, swipe, wait, type) and optionally repeat the sequence N times to amplify a leak that only manifests after iteration. Tied to verify-fix: pair with captureScenarioState before/after to make leak reproductions deterministic. Soft dependency on axe (https://github.com/cameroncooke/AXe) — when missing, returns a structured workaroundNotice with install instructions. Tap targets accept label, elementId, or explicit coords.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
simulatorUDIDYesUDID of the booted simulator. Use listTraceDevices to find one.
actionsYesOrdered list of UI actions: { type: 'tap', label|elementId|coords }, { type: 'swipe', from, to }, { type: 'wait', seconds }, or { type: 'type', text }.
repeatNoRun the entire actions sequence this many times. Default 1. Use 5-10 to amplify subtle leaks that accumulate per repetition.
settleBetweenActionsMsNoPause between consecutive actions in milliseconds. Default 500. Increase for animation-heavy flows.
finalUITreePathNoWhen provided, after the scenario completes the final UI tree is written here as JSON for the caller to verify the app ended in the expected state.
screenshotDirNov1.15+. DebugSwift-inspired. When provided, captures a simulator screenshot after each action into `<screenshotDir>/iteration-{N}_step-{M}.png`. Useful for 'what was on screen when the leak fired?' context in verify-fix loops. Uses `xcrun simctl io ... screenshot` directly (no axe dependency). Screenshot capture failures are non-fatal: surfaced in `failures[]` but do not halt the scenario.
Behavior4/5

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

With no annotations, the description carries full disclosure burden. It reveals repetition behavior, screenshot capture behavior (v1.15+, non-fatal failures), axe dependency handling via workaroundNotice, and pairing with captureScenarioState. Could mention what happens if elements are not found in UI.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with a clear purpose statement upfront, followed by key details in 4-5 sentences. Each sentence contributes unique information without repetition, maintaining excellent conciseness.

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?

Given 6 parameters, no output schema, and moderate complexity, the description covers main workflow, dependencies, and usage patterns. It lacks detailed error handling for individual actions but is otherwise complete for the context.

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 baseline is 3. The description adds value by providing usage hints (e.g., 'repeat 5-10 to amplify leaks', 'increase settleBetweenActionsMs for animation-heavy flows') and explaining behavior of screenshotDir and finalUITreePath, going beyond schema descriptions.

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 clearly states the tool drives a sequence of UI actions (tap, swipe, wait, type) and repeats them to amplify leaks. It distinguishes from siblings like captureScenarioState and ties to the verify-fix workflow, using specific verbs and resource context.

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?

The description explains when to use the tool (amplify leaks in verify-fix loops) and recommends pairing with captureScenarioState. It mentions a soft dependency on `axe` and provides workaround. However, it lacks explicit 'when not to use' instructions compared to alternatives.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/carloshpdoc/memorydetective'

If you have feedback or need assistance with the MCP directory API, please join our Discord server