memorydetective
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Capabilities
Features and capabilities supported by this server
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
| prompts | {
"listChanged": true
} |
| resources | {
"listChanged": true
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| analyzeMemgraphA | [mg.memory] Run Pipeline: → |
| findCyclesA | [mg.memory] Extract just the ROOT CYCLE blocks from a |
| findRetainersA | [mg.memory] Walk the cycle forest from a |
| countAliveA | [mg.memory] Count how many times each class appears in a |
| diffMemgraphsA | [mg.memory] Compare a baseline |
| classifyCycleA | [mg.memory] Match each ROOT CYCLE against a built-in catalog of 8 known antipatterns (TagIndexProjection cycle, ForEachState retention, Combine sink-store-self, Task-without-weak-self, NotificationCenter observer, viewmodel-wrapped-strong closure, UINavigationController host, _DictionaryStorage internal). Returns Pipeline: this is the killer tool — after the result, follow |
| analyzeHangsA | [mg.trace] Run |
| analyzeTimeProfileA | [mg.trace] Export the |
| listTraceDevicesA | [mg.discover] Run |
| listTraceTemplatesA | [mg.discover] Run |
| recordTimeProfileA | [mg.trace] Wrapper around |
| captureMemgraphA | [mg.memory] Wrapper around |
| analyzeAnimationHitchesA | [mg.trace] Parse the |
| analyzeAllocationsA | [mg.trace] Parse the |
| analyzeAppLaunchA | [mg.trace] Parse the |
| renderCycleGraphA | [mg.render] Read a |
| logShowA | [mg.log] Wrap |
| logStreamB | [mg.log] Wrap |
| detectLeaksInXCUITestA | [mg.ci] Build the workspace for testing, launch the test cycle, capture a baseline |
| reachableFromCycleA | [mg.memory] Cycle-scoped reachability + class counting. Answers questions like "how many |
| swiftGetSymbolDefinitionA | [mg.code] Find the file:line where a Swift symbol (class, struct, enum, protocol, func, var, etc.) is declared. Pre-scans |
| swiftFindSymbolReferencesA | [mg.code] Locates the symbol's declaration in |
| swiftGetSymbolsOverviewA | [mg.code] Cheap orientation: returns the top-level symbols (classes, structs, enums, protocols, free functions) declared in a Swift file via SourceKit-LSP's |
| swiftGetHoverInfoA | [mg.code] SourceKit-LSP |
| swiftSearchPatternA | [mg.code] Pure regex search over a file's contents — no SourceKit-LSP, no IndexStoreDB. Catches what LSP misses: closure capture lists ( |
| getInvestigationPlaybookA | [meta] Returns a versioned, declarative pipeline for a known investigation flow ( |
| verifyFixA | [mg.memory] Cycle-semantic diff. Classifies both Pipeline: this is the natural followup to |
| compareTracesByPatternA | [mg.trace][mg.ci] Trace-side counterpart to Pipeline: capture before/after |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
| investigate-leak | Run the canonical 6-step memgraph-leak investigation: analyzeMemgraph → classifyCycle → reachableFromCycle → swiftSearchPattern → swiftGetSymbolDefinition → swiftFindSymbolReferences. |
| investigate-hangs | Diagnose main-thread hangs from a `.trace` recorded with the Time Profiler or Hangs template. |
| investigate-jank | Diagnose dropped frames from a `.trace` recorded with the Animation Hitches template. |
| investigate-launch | Diagnose cold/warm launch slowness from a `.trace` recorded with the App Launch template. |
| verify-cycle-fix | Diff a before/after pair of `.memgraph` snapshots to confirm a fix actually closed the originally-classified cycle. |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
| SwiftUI .tag(...) closure-over-self cycle | SwiftUI .tag(...) closure-over-self cycle |
| SwiftUI _DictionaryStorage<…WeakBox<AnyLocationBase>> internal cycle | SwiftUI _DictionaryStorage<…WeakBox<AnyLocationBase>> internal cycle |
| SwiftUI ForEachState retained by tap-gesture closure | SwiftUI ForEachState retained by tap-gesture closure |
| Closure capturing `_viewModel.wrappedValue` strongly | Closure capturing `_viewModel.wrappedValue` strongly |
| UIViewControllerRepresentable + UINavigationController host cycle | UIViewControllerRepresentable + UINavigationController host cycle |
| Combine .sink/.assign closure capturing self via AnyCancellable | Combine .sink/.assign closure capturing self via AnyCancellable |
| Swift `Task { }` body strongly capturing self | Swift `Task { }` body strongly capturing self |
| NotificationCenter observer block capturing self | NotificationCenter observer block capturing self |
| Combine `.assign(to: \.x, on: self)` capturing self | Combine `.assign(to: \.x, on: self)` capturing self |
| Swift `Task { }` inside a SwiftUI View capturing self | Swift `Task { }` inside a SwiftUI View capturing self |
| NotificationCenter observer never deregistered | NotificationCenter observer never deregistered |
| `delegate` property declared without `weak` | `delegate` property declared without `weak` |
| Timer.scheduledTimer(target:selector:) retains its target | Timer.scheduledTimer(target:selector:) retains its target |
| CADisplayLink retains its target | CADisplayLink retains its target |
| UIGestureRecognizer / UIControl `addTarget` retains target | UIGestureRecognizer / UIControl `addTarget` retains target |
| `NSKeyValueObservation` token retains its change handler | `NSKeyValueObservation` token retains its change handler |
| URLSession retains its delegate strongly | URLSession retains its delegate strongly |
| SwiftUI `@EnvironmentObject` with back-reference to UIView/UIViewController | SwiftUI `@EnvironmentObject` with back-reference to UIView/UIViewController |
| `AsyncStream` continuation retains self via producer / onTermination | `AsyncStream` continuation retains self via producer / onTermination |
| `WKUserContentController.add(_:name:)` retains the handler | `WKUserContentController.add(_:name:)` retains the handler |
| DispatchSource event handler closure retains self | DispatchSource event handler closure retains self |
| RxSwift `DisposeBag` retains subscription closures capturing self | RxSwift `DisposeBag` retains subscription closures capturing self |
| Realm `NotificationToken` retains its change closure | Realm `NotificationToken` retains its change closure |
| Coordinator pattern: child holds parent strongly | Coordinator pattern: child holds parent strongly |
| CAAnimation retains its delegate (Apple's documented quirk) | CAAnimation retains its delegate (Apple's documented quirk) |
| Custom CALayer delegate pointing at non-UIView owner | Custom CALayer delegate pointing at non-UIView owner |
| NSFetchedResultsController retains its delegate | NSFetchedResultsController retains its delegate |
| @Observable class held as @State across modal presentation | @Observable class held as @State across modal presentation |
| NavigationPath retains every element ever pushed into it | NavigationPath retains every element ever pushed into it |
| `for await` over an infinite AsyncSequence pins self via the consuming Task | `for await` over an infinite AsyncSequence pins self via the consuming Task |
| `for await ... in NotificationCenter.notifications(named:)` retains self forever | `for await ... in NotificationCenter.notifications(named:)` retains self forever |
| Swift 6.2 `Observations { }` closure retains self | Swift 6.2 `Observations { }` closure retains self |
| WKScriptMessageHandler bridge: handler ↔ webview ↔ contentController cycle | WKScriptMessageHandler bridge: handler ↔ webview ↔ contentController cycle |
| SwiftData ModelContext retained by actor through DefaultSerialModelExecutor | SwiftData ModelContext retained by actor through DefaultSerialModelExecutor |
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