Skip to main content
Glama
carloshpdoc

memorydetective

Capture a labeled before/after snapshot for verify-fix

captureScenarioState

Capture scenario state to bracket fixes and validate retain cycle closure. Produces memgraph, screenshot, and UI tree artifacts for diffing.

Instructions

[mg.scenario] Composite snapshot: writes a .memgraph, a .png screenshot, and a .ui.json accessibility tree into outputDir, all prefixed by label (e.g. before / after). Designed to bracket a fix or a replayScenario call so you can chain into diffMemgraphs and validate that a cycle actually closed. Sub-captures are best-effort: if leaks fails (macOS 26.x minimal-corpse), the screenshot + UI tree still complete and the captureMemgraph workaroundNotice is surfaced for follow-up. Required: simulatorUDID, outputDir, and exactly one of pid / appName.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
simulatorUDIDYesUDID of the booted simulator hosting the target app. Used for screenshot + UI tree captures.
pidNoPID of the host-side app process. Mutually exclusive with `appName`. Pass the value returned by bootAndLaunchForLeakInvestigation.
appNameNoApp executable name as visible in pgrep. Mutually exclusive with `pid`.
outputDirYesAbsolute directory where the snapshot files are written. Created if it does not exist.
labelNoFilename prefix for the captured artifacts. Use "before" / "after" for verify-fix flows.snapshot
includeNoWhich artifacts to capture. Default captures all three.
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. It discloses that sub-captures are best-effort (if one fails, others still complete) and that a workaroundNotice is surfaced. It also notes required parameters, offering solid transparency for a composite tool.

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 a single, well-structured paragraph that front-loads the core function and important constraints. Every sentence adds value without redundancy.

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 the tool's complexity (multiple outputs, best-effort behavior, chaining with other tools), the description adequately covers the purpose, required inputs, and workflow context. No output schema is provided, but the description implicitly describes the output artifacts.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/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 context like using 'before'/'after' for label and the best-effort behavior, but does not significantly extend the meaning beyond the schema's 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 is a composite snapshot that writes three artifact types (.memgraph, .png, .ui.json) prefixed by a label. It differentiates from siblings like 'captureMemgraph' (which only captures memgraph) by specifying the multi-artifact nature and its role in before/after flows.

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 explicitly says it is 'designed to bracket a fix or a replayScenario call' and to 'chain into diffMemgraphs', providing clear usage context. However, it does not explicitly state when not to use this tool or list 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