Skip to main content
Glama
carloshpdoc

memorydetective

Verify a fix actually closed the targeted retain cycle

verifyFix

Compare before and after memory snapshots to get a per-pattern verdict on whether a fix resolved a retain cycle, returning PASS/PARTIAL/FAIL and bytes freed.

Instructions

[mg.memory] Cycle-semantic diff. Classifies both before and after .memgraph snapshots and emits a per-pattern PASS/PARTIAL/FAIL verdict plus bytes freed and instances released. Use as a CI gate: if expectedPatternId is provided, expectedPatternVerdict tells you in one field whether the fix landed.

Pipeline: this is the natural followup to classifyCycle after you've shipped a fix. Capture a fresh .memgraph, point this at the before/after pair.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
beforeYesAbsolute path to the baseline `.memgraph` (pre-fix).
afterYesAbsolute path to the post-fix `.memgraph`.
expectedPatternIdNoIf provided, the verdict is gated on whether this specific patternId disappeared from `after`. Defaults to checking every classified pattern.
expectedAliveClassesNov1.14+. Class names that legitimately stay alive across the before/after snapshots. Singletons, framework registrars, persistent caches. When a class in this list appears in regressionClasses[], it is moved to expectedAlive[] and does not flip the verdict to FAIL. Each entry can be a plain string (treated as case-insensitive substring, the v1.14 default behavior) OR an object `{ pattern: string, mode?: "exact" | "substring" | "regex" }` (v1.17+). Modes: - `exact`: case-insensitive full-string equality. Use for system class names that are stable. - `substring`: case-insensitive substring match (the v1.14 default). - `regex`: JavaScript regex (anchors / flags as written in the pattern). Use for nuanced class-name shapes. Merged with the curated default list (DebugSwift's ignoredViewControllerClassNames + ignoredViewClassNames + ignoredWindowClassNames, all `mode: "exact"`) unless `disableDefaultWhitelist: true`.
disableDefaultWhitelistNov1.14+. When true, the curated DEFAULT_EXPECTED_ALIVE_CLASSES list is NOT applied. Only the user-supplied expectedAliveClasses (if any) is used. Useful for strict regression mode in tests where every alive class should be evaluated.
verbosityNocompact
Behavior4/5

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

No annotations provided, so description carries full burden. It discloses the tool emits a 'per-pattern PASS/PARTIAL/FAIL verdict plus bytes freed and instances released', and explains conditional behavior with expectedPatternId. However, it does not mention any error conditions, permissions, or side effects, which is minor for a likely read-only diff 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 only three sentences, front-loading the core function with a domain tag. Every sentence provides essential information: what it does, output, usage as CI gate, and pipeline context. No wasted words.

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?

No output schema exists, but the description covers the main output elements (verdict, bytes freed, instances released). It also explains the pipeline placement. It could be more explicit about the exact structure of the output, but it is sufficient for typical use.

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 high (83%), so baseline is 3. The description adds context about expectedPatternId producing a verdict field, but this concerns output rather than input parameter semantics. It does not add meaning beyond the schema's own descriptions for 'before', 'after', or other parameters.

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 verifies a fix for a retain cycle, using a 'cycle-semantic diff' and emitting verdicts. It explicitly ties it to the tool 'classifyCycle' as a followup, distinguishing it from sibling tools like 'diffMemgraphs' or 'findCycles'. The verb 'verify' and resource 'fix for retain cycle' are specific.

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 directly says 'Use as a CI gate' and explains the pipeline: 'natural followup to classifyCycle after you've shipped a fix'. This tells the agent exactly when to invoke this tool and what the prior step is, excluding other contexts.

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