Skip to main content
Glama
carloshpdoc

memorydetective

by carloshpdoc

memorydetective

English · Português brasileiro

Diagnose iOS retain cycles and performance regressions from your chat window. No Xcode required.

npm CI License: Apache 2.0 GitHub stars macOS node

demo

Highlights

  • CLI-driven leak hunting. Read .memgraph files captured by Xcode (or by memorydetective itself on simulators), find ROOT CYCLEs, classify them against known SwiftUI/Combine patterns, and get a one-liner fix hint. All from a script or a chat.

  • MCP-native. Plugs into Claude Code, Claude Desktop, Cursor, Cline, and any other MCP client. The agent drives the full investigate → classify → suggest-fix loop without you opening Instruments.

  • Honest about its limits. No mocked outputs, no over-promises. Hangs analysis works clean from xctrace; sample-level Time Profile is parsed when xctrace symbolicates the trace and returns a structured workaround notice when it can't (the underlying xctrace SIGSEGV on heavy unsymbolicated traces is an Apple-side limitation we surface explicitly). Memory Graph capture works on Mac apps and iOS simulator; physical iOS devices still need Xcode.

What's new in v1.18 (2026-05-17): MetricKit + audit-close. analyzeMetricKitPayload is the 42nd MCP tool: ingests Apple MetricKit .mxdiagnostic JSON payloads from real-device TestFlight / App Store builds (post-mortem production diagnostics, no MCP competitor covers this lane today). Three actionable outputs: crash clusters by exception type / binary / top frame, hang hotspots with localized-duration parsing ("5.4 sec" / "20秒"), CPU + disk exceptions. Cross-tool chain hints (e.g. objc_release-style top frame surfaces a findCycles suggestion). Plus three audit-close items: open-enum SupportStatusKind (downstream consumers add kinds without a breaking type bump), invocation-scoped schemaDiscovery cache (summarizeTrace end-to-end shaved from ~28s to ~15s on real Apple traces via single up-front TOC fetch), and local-only integration tests against real Apple .trace bundles (closes the v1.14 P+O drift class for good). 701 → 757 tests. 41 → 42 MCP tools.

Also recent (v1.17): reliability pass. 14 bug fixes across three tiers. Headlines: strtobool env truthy parsing, verifyFix whitelist match modes (exact / substring / regex), recordViaInstrumentsApp catches traces saved outside watchDir, inspectTrace fault-tolerant fallback, configurable countAlive framework-noise filter, variable-size class min/max/median.

And v1.16: macOS 26.x recording-unblock release. New recordViaInstrumentsApp MCP tool wraps the Instruments.app GUI flow: opens the app, surfaces step-by-step instructions, watches a directory for the saved .trace, and chains into inspectTrace on success. Until Apple fixes the xcrun xctrace record regression on macOS 26.x sims, this is the automated path.

And v1.15: schema coverage + verify-fix UX. Three new MCP trace tools filled the remaining schema gap: analyzeMemoryFootprint (38th, VM resident / dirty / virtual + jetsam diagnosis), analyzeEnergyImpact (39th, battery drain investigation), analyzeLeakTimeline (40th, xctrace's leaks instrument as a time series). summarizeTrace now chains analyzeNetworkActivity. replayScenario captures simulator screenshots per step.

Earlier: v1.14 trace-side reliability, analyzeNetworkActivity, unified supportStatus[], FLEX-inspired countAlive size view, MLeaksFinder + DebugSwift-inspired verifyFix whitelist. v1.13 shipped summarizeTrace + /summarize-trace MCP prompt. v1.12 completed reference-tree propagation. v1.11 added inspectTrace, diffMemgraphs reference-tree. v1.9 shipped analyzeAbandonedMemory, detectLeaksInXCTest, cleanupTraces, mainThreadViolations. Full notes in CHANGELOG.

Heads up for macOS 26.x users: Apple shipped a task_for_pid kernel regression on macOS 26.x that blocks leaks --outputGraph, heap, AND xctrace --template Allocations against iOS simulator processes regardless of MallocStackLogging. Even Xcode's "View Memory Graph Hierarchy" hits it unless Malloc Stack Logging is enabled in the scheme's Diagnostics tab. memorydetective surfaces this as a proactive platformAdvisory on the first capture-class tool call, plus a workaroundNotice with issue: "macos-26-task-for-pid-broken" if leaks is invoked. The most reliable workaround today is to target an iOS 18 simulator runtime (install via Xcode > Settings > Platforms > +iOS 18.x). Empirically validated in the notelet investigation 2026-05-12 where three independent CLI memory-introspection paths all failed before iOS 18 was identified as the working escape hatch. Set MEMORYDETECTIVE_SUPPRESS_PLATFORM_ADVISORY=1 to silence the notice once you have settled on a workaround.

Also on macOS 26.x: xctrace record is broken for simulator targets. Independent from the task_for_pid regression above, xcrun xctrace record --time-limit Ns against iOS simulator processes wedges past the time limit, eventually exits when killed, and the resulting .trace bundle is missing template metadata. xctrace export --toc then fails with Document Missing Template Error. Re-validated against Xcode 26.5 (build 17F42, xctrace 16.0) 2026-05-15: regression survives the update. This hits the entire xctrace-based ecosystem the same way (memorydetective.recordTimeProfile, XcodeTraceMCP, and naked xcrun xctrace record calls all fail identically). Workarounds: (1) use recordViaInstrumentsApp (v1.16, hardened in v1.17), which opens Instruments.app for you, prompts you to record + save the .trace, then chains into inspectTrace automatically once the bundle appears. v1.17 also catches saves outside the watch directory via an Instruments.app AppleScript document query, returning savedOutsideWatchDir: true plus the actual path; (2) record from an older macOS host with Xcode 26.0 if you have one; (3) record against a physical device (the regression appears to be simulator-specific). v1.17 added a viability probe on recordTimeProfile (bundleStatus: "wedged" when the on-disk bundle is the 52K stub) and on inspectTrace (returns ok: true with diagnosis text instead of throwing). USAGE.md > Troubleshooting has a step-by-step.

Related MCP server: xcodeinstrumentmcp

Quickstart

npm install -g memorydetective

Add to your MCP client config (Claude Code shown):

// ~/.claude/settings.json
{
  "mcpServers": {
    "memorydetective": { "command": "memorydetective" }
  }
}

Or use it directly from the command line:

memorydetective analyze   ~/Desktop/myapp.memgraph
memorydetective classify  ~/Desktop/myapp.memgraph

→ See Examples for chat-driven flows · API for the full tool reference · Configure for Claude Desktop / Cursor / Cline · USAGE.md for the full walkthrough including how fixes flow from diagnosis to your codebase.


Examples

Realistic chat snippets. The agent calls the MCP tools listed in API.

Diagnose a leak from a memgraph

You: I just exported a memory graph at ~/Desktop/example.memgraph. Something's leaking after I close a detail screen. What is it?

Claude: (calls analyzeMemgraphclassifyCycle) Found 4 ROOT CYCLE blocks across 60,436 leaks. The dominant one matches swiftui.tag-index-projection with high confidence. A closure attached via .tag() on a photo carousel ForEach is capturing self strongly through _viewModel.wrappedValue, which keeps DetailViewModel and the navigation coordinator alive after dismissal.

Suggested fix: replace [weak self] capture in the tap handler with a static helper, or weak-capture the view-model via [weak coord = self.coordinator]. Want me to find the exact file?

Verify a fix actually worked

You: I shipped the fix. Compare ~/Desktop/before.memgraph to ~/Desktop/after.memgraph and tell me whether DetailViewModel count dropped.

Claude: (calls diffMemgraphscountAlive) DetailViewModel: 12 → 0 (delta -12). The swiftui.tag-index-projection cycle is gone. Total leak count fell from 60,436 to 55,576 (−4,860). Three other ROOT CYCLEs persist. They're SwiftUI internals, not your code.

Self-contained verify-fix loop (v1.8)

When leaks --outputGraph fails on macOS 26.x (Failed to get DYLD info for task), the cause is usually that the app was not launched with MallocStackLogging=1. The new orchestration tools handle this end to end without you wiring up xcodebuild + simctl + axe yourself.

You: Reproduce the leak in MyApp for me. Build, launch with the right env vars, repeat the photo carousel flow 5 times to amplify it, capture before, then I'll ship the fix and you capture after.

Claude: (calls bootAndLaunchForLeakInvestigation) Built + booted iPhone 15 (UDID ABCD-...). Launched MyApp (PID 49581) with MallocStackLogging=1. Bundle id com.example.MyApp.

(calls replayScenario with 5 taps on the carousel + back-button cycle, repeat 5) Executed 25 actions in 12.3s. No failures.

(calls captureScenarioState({label:"before"})) Wrote before.memgraph (63,201 leaks), before.png, before.ui.json. MallocStackLogging active, no workaroundNotice.

(you ship the fix and rebuild)

(calls bootAndLaunchForLeakInvestigation + replay + captureScenarioState({label:"after"}))

(calls diffMemgraphsverifyFix) DetailViewModel: 15 → 0. swiftui.tag-index-projection PASS. Bytes freed: 28.4 MB.

Find the slow path on a real device

You: Profile DemoApp on my iPhone for 90 seconds and tell me where the hangs are.

Claude: (calls listTraceDevicesrecordTimeProfileanalyzeHangs) Recorded ~/Desktop/run.trace (90s, attached to DemoApp on iPhone 17 Pro Max). Found 23 user-visible hangs (>500 ms each), longest 1.16 s, average 769 ms. Severe load. All on the main thread. Sample-level hotspots aren't symbolicated yet; open the trace in Instruments for that step (analyzeTimeProfile returns a structured workaround notice when xctrace can't symbolicate. See CHANGELOG known limits).

Analyze MetricKit payloads from real-user crashes (v1.18)

You: I have a folder of .mxdiagnostic files from the last 30 days of TestFlight at ~/Downloads/metrickit-may/. What's catching real users?

Claude: (calls analyzeMetricKitPayload({ payloadDir: "~/Downloads/metrickit-may/" })) 47 payloads, 2026-04-15 → 2026-05-15. Top: 18 crashes EXC_BAD_ACCESS clustered on the same top frame, all in builds 456 and 457 (clean on 458 + earlier). Pattern matches retain-cycle release; chain hint surfaces findCycles next.

Second: 5.4s hang on libsqlite3.dylib (3 samples). Pattern db-lock. If you reproduce locally, chain into analyzeHangs with includeStackClassification: true for the mainThreadViolations[] classifier.

No symbolicated frames in v1.18 (raw binaryUUID + offset shipped; dSYM lookup is a separate tool, future release). Localized hang strings handled: input was "5.4 sec", normalized to 5400ms; one diagnostic carried "20秒" (Japanese), normalized to 20000ms.

See USAGE.md § MetricKit production post-mortem for the full end-to-end including how to wire analyzeMetricKitPayload into a verify-fix loop across multiple TestFlight builds.

End-to-end: leak → file → fix suggestion

The full loop, from artifact to code edit. Combines memory-graph analysis with Swift source-bridging.

You: Tem um leak. Memgraph em ~/Desktop/example-leaks.memgraph. The cycle points at DetailViewModel. Find where it lives in the project ~/Development/myapp/ and suggest a fix.

Claude: (calls analyzeMemgraphclassifyCyclereachableFromCycle) Found 4 ROOT CYCLE blocks. The dominant one matches swiftui.tag-index-projection with high confidence. reachableFromCycle confirms 4 DetailViewModel instances pinning ~1100 NSURLSessionConfigurations each. The VM is the culprit, the network stack is collateral.

(calls swiftSearchPattern to locate .tag( + onImageSliderTap patterns in ~/Development/myapp/Sources/) 1 match in MyApp/Views/MediaCarousel.swift:142.

(calls swiftGetSymbolDefinition({ symbolName: "DetailViewModel", projectRoot: "...", candidatePaths: ["MyApp/ViewModels/"] })) Declared at MyApp/ViewModels/DetailViewModel.swift:18. class DetailViewModel: ObservableObject.

(calls swiftFindSymbolReferences to scope the blast radius. 7 callsites)

Suggested fix at MediaCarousel.swift:142:

// before
.tag(index)
.onImageSliderTap { index in
    self.viewModel.handlePhotoTap(at: index)
}

// after. Static helper + weak captures
.tag(index)
.onImageSliderTap { [weak vm = _viewModel.wrappedValue,
                     weak coord = self.coordinator] index in
    Self.handlePhotoTap(index: index, viewModel: vm, coordinator: coord)
}

Want me to apply this and verify with a fresh .memgraph?


What it saves you

The pitch in one sentence: memorydetective turns a 50-500 MB binary memgraph (or a 200 KB leaks(1) text dump) into a 2-5 KB structured summary your AI agent can actually reason about. That changes the economics of using an LLM for iOS perf investigation.

Tokens (when paired with an AI agent like Claude / Cursor / Cline)

A real-world retain-cycle investigation, run twice. Once with memorydetective, once with the agent reading the raw leaks(1) output directly:

Step

Without MCP (agent reads raw output)

With memorydetective

Load leaks text dump (~280 KB)

~70,000 input tokens

n/a

analyzeMemgraph summary

n/a

~750 input tokens

classifyCycle + fix hint

agent re-reasons over the dump per follow-up (3-4 extra turns)

1 turn, structured patternId + fixHint

findRetainers / reachableFromCycle

agent re-scans the dump

~500 tokens, scoped query

Net per investigation

~85,000 tokens, ~6 turns

~3,000 tokens, ~2 turns

Translates to roughly $0.40-$1.20 per investigation depending on the model (Claude Opus / Sonnet / Haiku). Compounds linearly with file size and investigation depth.

Developer time

The same investigation, measured by the developer:

Step

Without MCP

With memorydetective

Capture memgraph + run leaks

5 min

5 min (same)

Read & interpret leaks text dump

15-30 min (skim 200 KB of repetitive frames)

30 sec (read 3 KB summary)

Identify the responsible pattern

10-20 min (recognize the cycle shape from experience)

instant (classifier returns patternId + fix hint)

Locate the suspect type in source

10-15 min (grep + manual navigation)

30 sec (swiftGetSymbolDefinition returns file:line)

Find every callsite to gauge fix blast radius

5-10 min (Xcode / grep)

10 sec (swiftFindSymbolReferences)

Net wall-clock

45-80 min

~10 min

Numbers are rounded from a single anonymized real investigation (a SwiftUI retain cycle over a tagged ForEach that pinned ~28 MB of network-stack state). Your mileage will vary with cycle complexity and codebase size.

When the win is marginal

Be honest about where this doesn't help much:

  • Tiny memgraphs (a single cycle, < 50 KB raw): MCP overhead is roughly token-neutral vs. Raw read. The dev-time win still holds (no manual cycle parsing) but the token win shrinks.

  • One-shot symbol lookups without a leak attached: just use grep, you don't need this.

  • First-time investigations on a new codebase: the agent still needs orientation turns regardless of MCP. The compounding wins kick in on the second and later investigations once the agent has cached the project's shape.

The win compounds with (a) file size, (b) investigation depth (multi-turn), and (c) how many leaks you investigate per quarter. For a single dev fixing one leak per year, the value is mostly the dev-time saving. For a team running CI gates with verifyFix across every PR, the token + time savings stack across hundreds of runs.


Configure

The memorydetective binary speaks MCP over stdio. Point any MCP-compatible client at it.

// ~/.claude/settings.json (global) or .mcp.json (per-project)
{
  "mcpServers": {
    "memorydetective": { "command": "memorydetective" }
  }
}
// ~/Library/Application Support/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "memorydetective": { "command": "memorydetective" }
  }
}

Restart Claude Desktop after editing.

// ~/.cursor/mcp.json
{
  "mcpServers": {
    "memorydetective": { "command": "memorydetective" }
  }
}
// VS Code settings.json
{
  "cline.mcpServers": {
    "memorydetective": { "command": "memorydetective" }
  }
}

Kiro supports MCP servers via its global config. The block mirrors Claude Desktop's:

{
  "mcpServers": {
    "memorydetective": { "command": "memorydetective" }
  }
}

Consult Kiro's MCP setup docs for the exact config file path on your system.

GitHub Copilot supports MCP servers in Agent mode (VS Code 1.94+). Add to .vscode/mcp.json in your repo:

{
  "servers": {
    "memorydetective": {
      "type": "stdio",
      "command": "memorydetective"
    }
  }
}

Copilot's MCP integration moves fast. If this snippet is stale, see the VS Code MCP docs.

Environment variables

Every boolean MEMORYDETECTIVE_* flag below accepts the strtobool truthy set (case-insensitive): 1 / true / t / yes / y / on (truthy) and 0 / false / f / no / n / off (falsy). Unrecognized values emit a one-time stderr warning per variable and fall back to the documented default. Pre-v1.17 the parser was 1-only, which caused silent no-ops when operators exported =true or =yes. The advisory warning is gated on MEMORYDETECTIVE_SUPPRESS_PLATFORM_ADVISORY.

Variable

Default

Effect

MEMORYDETECTIVE_REDACTION

balanced

Output scrubbing applied to every tool response. balanced collapses home-directory paths to ~/... and masks token-shaped secrets (AWS keys, GitHub PATs, Stripe, Slack, Bearer auth). strict adds hostname, IPv4, and bundle-identifier masking. off disables redaction (useful for local-only debugging). Mode is logged once at server startup.

MEMORYDETECTIVE_ALLOW_LAUNCH

unset

Boolean (strtobool). Allows bootAndLaunchForLeakInvestigation. The tool executes xcodebuild and xcrun simctl launch against caller-supplied paths and bundle ids, so opt-in is required. Without the gate, the tool returns ok: false with state: launchNotAllowed and a clear explanation. Set this only when you trust the inputs the agent is producing.

MEMORYDETECTIVE_MAX_RECORDING_SECONDS

300

Cap on recordTimeProfile.durationSec. Requests above the cap are rejected with a clear error. Bounded internally to a 3600s (1h) hard ceiling so a misconfigured env var cannot disable the gate.

MEMORYDETECTIVE_TRACE_ROOT

~/Library/Application Support/memorydetective/traces

Directory used when recordTimeProfile.output is a relative path. Absolute paths bypass this default for v1.8 backwards-compat. Also the default scan path for cleanupTraces. The directory is auto-created on first write.

MEMORYDETECTIVE_ALLOW_EXTERNAL_CLEANUP

unset

Boolean (strtobool). Allows cleanupTraces to scan and delete .trace bundles OUTSIDE MEMORYDETECTIVE_TRACE_ROOT. Without it, requests that resolve outside the configured root return ok: false with the failure reason and delete nothing. Default-deny on destructive disk operations outside the configured boundary.

MEMORYDETECTIVE_SUPPRESS_PLATFORM_ADVISORY

unset

Boolean (strtobool). Silences the macOS 26.x platform advisory that captureMemgraph, captureScenarioState, and bootAndLaunchForLeakInvestigation emit on first use. Also silences the v1.17 stderr warnings emitted on unrecognized boolean values (any MEMORYDETECTIVE_* flag) and on schemaDiscovery TOC fetch failures. Useful once you have an iOS 18 sim runtime installed and do not need the reminders.

MEMORYDETECTIVE_AUTO_OPEN_INSTRUMENTS

unset

Boolean (strtobool). Makes recordTimeProfile invoke open -a Instruments <tracePath> as a fire-and-forget escape hatch when xctrace times out (the macOS 26.x regression). v1.17 adds a MANIFEST.plist viability check before opening so the auto-open path skips wedged 52K stub bundles (which would otherwise present a "Document Missing Template Error" dialog in Instruments.app). The response's openedInInstrumentsApp field reports whether the open was invoked; bundleStatus (v1.17) reports whether the bundle on disk is unknown / salvageable / wedged.

MEMORYDETECTIVE_PREFLIGHT_XCTRACE

unset (auto)

Boolean (strtobool) + auto. Controls the pre-flight probe in recordTimeProfile that detects the macOS 26.x xctrace wedge in ~3-5 seconds instead of paying the user's full durationSec plus 30s grace. Truthy forces on regardless of platform / target. Falsy forces off. When unset, the probe auto-enables on macOS 26.x simulator attach (the known-broken combo) and stays off elsewhere. Pre-flight is skipped for --launch mode to avoid double-launching the app. Side-effect of auto-enable: 2-second probe runs before the full recording starts.


API

42 MCP tools + 34 Resources + 7 Prompts, grouped by purpose. Tool descriptions are tagged with a category prefix ([mg.memory], [mg.trace], [mg.build], [mg.scenario], [mg.code], [mg.log], [mg.render], [mg.ci], [mg.discover], [ops], [meta]) so related tools are visible at a glance.

Many tools include a suggestedNextCalls field in their response. A typed list of { tool, args, why } entries pre-populated from the current result, so the orchestrating LLM can chain calls without re-reasoning. Start with getInvestigationPlaybook(kind) for the canonical sequence. Or just type /investigate-leak (one of the Prompts) in any client that exposes MCP slash commands.

The cycle classifier ships 36 named antipatterns spanning SwiftUI (including the Swift 6 / @Observable / SwiftData / NavigationStack era, plus the v1.9 swiftui.observable-write-on-every-render shape), Combine, Swift Concurrency (incl. AsyncSequence-on-self and the new Observations API), UIKit (Timer/CADisplayLink/UIGestureRecognizer/KVO/URLSession/WebKit/DispatchSource, plus the v1.9 uikit.viewcontroller-retained-after-pop shape), Core Animation, Core Data, Coordinator pattern, and the popular third-party libs RxSwift + Realm. Each pattern carries:

  • a textual one-line fixHint

  • a confidence tier (high / medium / low)

  • a staticAnalysisHint pointing at the SwiftLint rule that complements the runtime evidence (or an explicit gap notice when no rule exists. Reinforces the differentiator: memorydetective sees what linters miss at parse time)

  • a fixTemplate with concrete Swift before/after snippets (new in v1.7) the agent can adapt directly to the user's code via the SourceKit-LSP source-bridging tools

Read & analyze (14)

All 9 trace-side analyzers below accept an optional second argument AnalyzeTraceOptions (v1.18 D-02). When called by summarizeTrace (which runs schema discovery once up front), the cache is forwarded so the per-analyzer xctrace --toc calls are skipped. Direct callers leave the option unset and behavior is identical to v1.17.

Tool

What

analyzeMemgraph

Run leaks against a .memgraph and return summary (totals, ROOT CYCLE blocks, plain-English diagnosis).

findCycles

Extract just the ROOT CYCLE blocks as flattened chains, with optional className substring filter.

findRetainers

"Who is keeping <class> alive?". Returns retain chain paths from a top-level node down to the match.

countAlive

Count instances by class. Provide className for one number, or omit for top-N most-leaked classes. v1.17: configurable noise filter (excludeFrameworkNoise, additionalNoisePatterns, unsuppressClassPatterns, noiseAuditMode) so the actionable view is tunable per app. Variable-size classes report instanceSizeBytesMin / Max / Median (was first-observed value pre-v1.17).

reachableFromCycle

Cycle-scoped reachability. "How many <X> instances are reachable from the cycle rooted at <Y>?". Distinguishes the actual culprit from its retained dependencies.

diffMemgraphs

Compare two .memgraph snapshots: total deltas + class-count changes + cycles new/gone/persisted.

analyzeAbandonedMemory

Diff two .memgraph snapshots on heap reference-tree class counts (not cycle list) and classify each grown class as kvo-observer-orphaned, notificationcenter-observer-leaked, cache-too-aggressive, singleton-retains-payload, or unknown-growth. Surfaces the family of bugs leaks(1) reports as leakCount: 0 because no strict cycle exists. v1.10 adds actionableGrowth[] + actionableShrinkage[] (framework-noise-filtered views) and supports outputFormat: "verify-fix-table" which emits a focused Class | Before | After | Delta markdown table directly.

verifyFix

Cycle-semantic diff: per-pattern PASS/PARTIAL/FAIL verdict + bytes freed. CI-gateable. expectedAliveClasses whitelist (v1.14) carves out singletons / caches / OS-retained windows so they do not vote FAIL; v1.17 extends each entry to per-mode matching ({ pattern, mode: "exact" | "substring" | "regex" }), with bare strings keeping the substring default.

classifyCycle

Match each ROOT CYCLE against a built-in catalog of 36 named antipatterns (SwiftUI / Combine / Concurrency / UIKit / Core Animation / Core Data / Coordinator / RxSwift / Realm) with confidence + textual fixHint + staticAnalysisHint (which SwiftLint rule complements this, or explicit gap) + fixTemplate (Swift before/after snippet).

analyzeHangs

Parse xctrace potential-hangs schema; return Hang vs Microhang counts + top N longest. Pass topFramesByHangStartNs (typically from a chained analyzeTimeProfile correlation) to enrich each top hang with mainThreadViolations[] classifying the blocker as sync-io, db-lock, network, or lock-contention.

analyzeAnimationHitches

Parse xctrace animation-hitches schema; report by-type counts and how many hitches crossed Apple's user-perceptible 100ms threshold.

analyzeTimeProfile

Parse xctrace time-profile schema; return top symbols by sample count. Reports SIGSEGV with workarounds when xctrace can't symbolicate.

analyzeAllocations

Parse xctrace allocations schema; return per-category aggregates (cumulative bytes, allocation count, lifecycle = transient/persistent/mixed) and top allocators.

analyzeAppLaunch

Parse xctrace app-launch schema; return cold/warm launch type + per-phase breakdown (process-creation, dyld-init, ObjC-init, AppDelegate, first-frame).

logShow

One-shot query of macOS unified logging via log show --style compact with predicate / process / subsystem filters. Returns parsed entries (timestamp, type, process, subsystem, category, message).

Capture / record (4)

Tool

What

Sim

Device

recordTimeProfile

Wrap xcrun xctrace record --template "Time Profiler" --attach ... --time-limit Ns --output .... Returns bundleStatus: "unknown" | "salvageable" | "wedged" (v1.17) so callers can branch on on-disk reality after a timeout instead of trusting the tracePath blindly. Auto-open path (MEMORYDETECTIVE_AUTO_OPEN_INSTRUMENTS) probes MANIFEST.plist before launching Instruments.app to skip wedged 52K stubs.

recordViaInstrumentsApp

macOS 26.x escape hatch (v1.16). Opens Instruments.app via open -a Instruments, returns an instructions[] array telling the user which template to pick + when to hit Record / Stop / Save, then polls watchDir every 5s for new .trace bundles (mtime-stable for 10s). v1.17: also queries running Instruments.app via AppleScript every poll for any saved document outside watchDir. On match, returns the path with savedOutsideWatchDir: true so users who hit Save and accepted the Desktop default no longer time out. Chains into inspectTrace on success.

captureMemgraph

Wrap leaks --outputGraph <path> <pid>. Resolves appName → pid via pgrep -x. Returns a structured workaroundNotice on the macOS 26.x Failed to get DYLD info for task regression with stable issue ids (minimal-corpse, permission-denied, leaks-not-found, transient) and a fallback path to recordTimeProfile (Allocations) + analyzeAllocations.

❌. Use Xcode

logStream

Wrap log stream --style compact for a bounded duration (≤ 60 s). Returns parsed entries collected during the window.

n/a

n/a

Verify-fix orchestration (3, v1.8)

These three tools combine into a single deterministic verify-fix loop: launch the app with MallocStackLogging=1 so leaks works, drive the UI to amplify the suspected leak, snapshot before, ship the fix, snapshot after, then diffMemgraphs.

Tool

What

bootAndLaunchForLeakInvestigation

Single-call build + boot + install + launch with MallocStackLogging=1 propagated via SIMCTL_CHILD_*. Resolves the simulator (udid, name+os, or whichever is booted), discovers BUILT_PRODUCTS_DIR / WRAPPER_NAME / EXECUTABLE_NAME / PRODUCT_BUNDLE_IDENTIFIER from xcodebuild -showBuildSettings -json, and returns the host PID + UDID + bundle id ready to chain into captureMemgraph. Required because leaks --outputGraph regressed on macOS 26.x and only works when the target was launched with malloc-stack-logging in its environment.

replayScenario

Drive the iOS Simulator through tap / swipe / wait / type actions with a repeat count to amplify leaks that only manifest after N iterations. Tap targets accept label, elementId, or coords. Soft dependency on Cameron Cooke's axe CLI.

captureScenarioState

Composite snapshot for verify-fix: writes .memgraph + .png screenshot + .ui.json accessibility tree into outputDir, all prefixed by label (typically before / after). Sub-captures are best-effort: if leaks fails on macOS 26.x the screenshot + UI tree still complete and the captureMemgraph workaroundNotice is surfaced via memgraphWorkaroundNotice.

Discover (3)

Tool

What

listTraceDevices

Parse xcrun xctrace list devices (devices + simulators + UDIDs).

listTraceTemplates

Parse xcrun xctrace list templates (standard + custom).

inspectTrace

Orientation tool for .trace bundles. Returns schemas present + row counts + device/OS/template metadata + suggestedNextCalls[] mapping each populated known schema to its analyzer. Use this as the FIRST call on any .trace. New in v1.11. v1.17: fault-tolerant, returns ok: true with schemas: [] and a diagnosis string when xctrace export --toc fails on wedged 52K bundles, instead of throwing.

Synthesize (1)

Tool

What

summarizeTrace

Single call that chains inspectTrace + the 5 analyzers in parallel + cross-correlates findings (hangs overlapping with hitches, etc.) + pre-renders a compact (<10 KB) markdown summary card with a 1-sentence headline, per-area sub-sections, and suggestedNextCalls. The "trace-to-summary-card-in-one-call" play. Use this when you want one synthesis pass instead of chaining 5-6 analyzers manually. New in v1.13. v1.18 D-02: runs schema discovery once up front and shares the cache with all 6 analyzers, shaving 600-3000ms of wall-clock on real Apple traces.

Production diagnostics (1, v1.18)

Tool

What

analyzeMetricKitPayload

Ingest Apple MetricKit .mxdiagnostic JSON payloads from real-device TestFlight / App Store builds (no MCP competitor covers this lane today). Three input forms: payloadPath (single file), payloadDir (aggregate across all .mxdiagnostic files in a directory), payloadJson (raw, in-memory). Three output sections: crashCluster[] (grouped by exception-type / binary / top-frame, each entry carries topFrame + affectedBuilds[] + raw binaryUUID + offset for downstream dSYM symbolication), hangHotspots[] (sorted by hangDurationMs with localized-duration parsing: "5.4 sec" / "20秒" / etc.), cpuExceptions[] + diskWriteExceptions[]. Emits 4 new SupportStatusKind values. Cross-tool chain hints fire automatically (objc_release-style top frame → findCycles; libsqlite3 top frame → analyzeHangs with main-thread-violation classifier). NO symbolication in v1; raw bytes only. Simulator does NOT generate MetricKit payloads (Apple-side limitation); positioned as post-mortem analyzer, not live capture. New in v1.18.

Render (1)

Tool

What

renderCycleGraph

Read a .memgraph, pick a ROOT CYCLE, and emit a Mermaid graph (markdown-embeddable) or Graphviz DOT. App-level classes highlighted in red; CYCLE BACK terminators amber.

Ops (1)

Tool

What

cleanupTraces

Preview and delete .trace bundles under MEMORYDETECTIVE_TRACE_ROOT. dryRun: true by default (the agent has to opt into deletion). Stops at the .trace boundary (does NOT descend INTO bundles). External roots require MEMORYDETECTIVE_ALLOW_EXTERNAL_CLEANUP=1 (default-deny). Useful as a periodic call once a few recordTimeProfile sessions have accumulated tens to hundreds of MB of traces.

CI / test integration (3)

Tool

What

detectLeaksInXCTest

Build the unit-test scheme, run with an optional -only-testing: filter, capture .memgraph baseline + after against the xctest runner (or a custom processName for app-hosted bundles), diff. Returns passed: false when new ROOT CYCLEs appear that aren't in the user's allowlist. Set outputHtmlPath to also write a self-contained HTML report. CI-runnable.

detectLeaksInXCUITest

XCUITest sibling: build the workspace, run the named XCUITest, capture .memgraph baseline + after against the host app, diff. Returns passed: false when new ROOT CYCLEs appear that aren't in the user's allowlist. Set outputHtmlPath to also write a self-contained HTML report. CI-runnable.

compareTracesByPattern

Trace-side counterpart to verifyFix. Compares two .trace bundles for a perf category (hangs, animation-hitches, or app-launch) and returns PASS/PARTIAL/FAIL with before/after stats and deltas. Apply thresholds: hangs PASS when longest is below hangsMaxLongestMs; hitches PASS when longest is below hitchesMaxLongestMs (default 100ms. Apple's user-perceptible threshold); app-launch PASS when total is below appLaunchMaxTotalMs (default 1000ms).

Add memorydetective to your CI in 5 minutes

detectLeaksInXCTest + outputHtmlPath are the building blocks for a per-PR leak gate. The job below runs the named unit-test scheme on every push and PR, uploads the HTML report as a workflow artifact, and fails when new ROOT CYCLEs appear outside the allowlist. Copy the file into .github/workflows/leaks.yml and adjust the workspace + scheme + test identifier:

name: leaks
on: [push, pull_request]
jobs:
  detect-leaks:
    runs-on: macos-14
    timeout-minutes: 30
    steps:
      - uses: actions/checkout@v4
      - run: sudo xcode-select -s /Applications/Xcode_15.4.app
      - run: npm install -g memorydetective
      - run: |
          xcrun simctl boot "iPhone 15" || true
          xcrun simctl bootstatus "iPhone 15" -b
      - run: |
          cat > leaks.json <<EOF
          {
            "workspace": "DemoApp.xcworkspace",
            "scheme": "DemoAppTests",
            "destination": "platform=iOS Simulator,name=iPhone 15,OS=18.0",
            "testCaseFilter": "DemoTests/LeakSensitiveCase",
            "outputHtmlPath": "${GITHUB_WORKSPACE}/leak-report.html",
            "allowlistPatterns": ["SwiftUI", "_TtC"]
          }
          EOF
          memorydetective tool detectLeaksInXCTest --input leaks.json
      - if: always()
        uses: actions/upload-artifact@v4
        with:
          name: leak-report
          path: leak-report.html
          retention-days: 14

The same file is in examples/ci/github-actions-leaks.yml if you want to copy it verbatim. Notes:

  • Simulator runtime: pin to iOS 18 on macos-14 runners. The macOS 26.x kernel regression (task_for_pid) breaks leaks against iOS 26 sims; iOS 18 is the canonical escape hatch (see the Highlights callout above).

  • Allowlist patterns: substrings matched against the leaking ROOT CYCLE's root class. Use them to mask known pre-existing leaks while you work the backlog. _TtC covers Swift mangled class prefixes that occasionally show up in SwiftUI internals.

  • HTML artifact: the report is self-contained (inline CSS, no external assets), so PR-comment bots and reviewers can preview it directly from the artifact URL.

  • Build cache: add actions/cache@v4 keyed on Package.resolved + *.xcconfig to skip build-for-testing rebuilds across runs. Then pass --skipBuild to the second invocation when chaining multiple detectLeaksInXCTest calls on the same job.

Swift source bridging (5)

Pair the memory-graph diagnosis with source-code lookups via SourceKit-LSP. Closes the loop "found this leak in the cycle → find the file/line in your project".

Tool

What

swiftGetSymbolDefinition

Locate the file:line where a Swift symbol is declared. Pre-scans candidatePaths (or hint.filePath) with a fast regex, then asks SourceKit-LSP for jump-to-definition.

swiftFindSymbolReferences

Find every reference to a Swift symbol via SourceKit-LSP textDocument/references. Requires an IndexStoreDB for cross-file results. The response carries a needsIndex hint when the index is missing.

swiftGetSymbolsOverview

List top-level symbols (classes, structs, enums, protocols, free functions) in a Swift file via documentSymbol. Cheap orientation when the agent lands in a new file.

swiftGetHoverInfo

Type info / docs at a (line, character) position. Disambiguates self captures: a class self in a closure can leak; a struct self can't.

swiftSearchPattern

Pure regex search over a Swift file (no LSP, no index). Catches what LSP misses: closure capture lists, Task { ... self ... } blocks, custom patterns from a leak chain.

These tools require macOS + Xcode (full Xcode, not just Command Line Tools. xcrun sourcekit-lsp must be available). They start a sourcekit-lsp subprocess per project root and reuse it across calls; the subprocess shuts down after a 5-minute idle window.

Why captureMemgraph doesn't work on physical iOS devices: leaks(1) only attaches to processes running on the local Mac (which includes iOS simulators). Memory Graph capture from a real device goes through Xcode's debugger over USB/lockdownd. Different mechanism, no public CLI equivalent.

Resources (34)

The cycle-pattern catalog is also surfaced as MCP resources, browsable at memorydetective://patterns/{patternId}. Each resource is a markdown body with the pattern name, a longer description, and the fix hint. Use this to let an agent (or a human in a UI-aware MCP client) browse the catalog without burning a classifyCycle call.

memorydetective://patterns/swiftui.tag-index-projection
memorydetective://patterns/concurrency.async-sequence-on-self
memorydetective://patterns/webkit.wkscriptmessagehandler-bridge
memorydetective://patterns/swiftdata.modelcontext-actor-cycle
…

resources/list returns all 34 entries. resources/read resolves any memorydetective://patterns/{id} URI to its markdown body.

Prompts (7)

Investigation playbooks are exposed as MCP prompts (slash commands in clients that surface them, e.g. Claude Code).

Slash command

What it does

Args

/investigate-leak

Runs the canonical 6-step memgraph-leak investigation: analyzeMemgraphclassifyCyclereachableFromCycleswiftSearchPatternswiftGetSymbolDefinitionswiftFindSymbolReferences.

memgraphPath

/investigate-hangs

Diagnose user-visible main-thread hangs from a .trace.

tracePath

/investigate-jank

Diagnose dropped frames / animation hitches from a .trace.

tracePath

/investigate-launch

Diagnose cold/warm launch slowness from a .trace.

tracePath

/verify-cycle-fix

Diff a before/after pair of .memgraph snapshots to confirm a fix landed.

before, after

/summarize-trace

Single-call cross-schema summary card for a .trace. Wraps summarizeTrace. v1.13+.

tracePath

/investigate-metrickit

Post-mortem flow for Apple MetricKit .mxdiagnostic payloads from TestFlight / App Store builds. Wraps analyzeMetricKitPayload with crashCluster + hangHotspots + cpuExceptions + diskWriteExceptions reading priority + cross-tool chain hints (objc_release → findCycles, sqlite → analyzeHangs). v1.18+.

payloadPath

Each prompt fills the canonical playbook's argument templates with the user-provided values, then hands the agent a ready-to-execute brief. Calls the same tools listed in Read & analyze. Prompts are an orchestration shortcut, not a separate engine.

CLI mode

The same binary is also a thin CLI for scripting and CI:

memorydetective analyze   <path-to-.memgraph>          # totals, ROOT CYCLEs, diagnosis
memorydetective classify  <path-to-.memgraph>          # match patterns + render fix hint
memorydetective tool      <toolName> --input <json>    # generic dispatcher for any MCP tool
memorydetective --help
memorydetective --version

When called with no arguments, the binary starts as an MCP server over stdio.

The tool subcommand dispatches to any registered MCP tool by name, reading inputs from a JSON file. Exit code is 0 when the tool returns ok && passed !== false, 1 otherwise, so it slots cleanly into CI gates. Currently supported tool names: detectLeaksInXCTest, detectLeaksInXCUITest (the CI recipe above uses this).


Requirements

  • macOS with Xcode Command Line Tools (xcode-select --install)

  • Node.js ≥ 20

Develop

git clone https://github.com/carloshpdoc/memorydetective
cd memorydetective
npm install
npm test                  # 758 unit tests
npm run build             # build → dist/
npm run dev               # tsx, stdio mode (dev mode)
./scripts/demo.sh         # full demo against a real .memgraph (set MEMGRAPH=path)

Contributing

Contributions are welcome. Bug reports, feature requests, new cycle patterns, all of it.

  • Bugs / feature requests: open an issue.

  • PRs: fork → branch → npm install → make changes → npm test (758 tests must stay green) → open a PR with a concise description of what changed and why.

Adding a cycle pattern to classifyCycle

classifyCycle ships with 36 built-in patterns covering SwiftUI (incl. Swift 6 / @Observable / SwiftData / NavigationStack / the v1.9 observable-write-on-every-render and viewcontroller-retained-after-pop shapes), Combine, Swift Concurrency (incl. AsyncSequence-on-self and Observations), UIKit (Timer / CADisplayLink / UIGestureRecognizer / KVO / URLSession / WebKit / DispatchSource), Core Animation, Core Data, the Coordinator pattern, RxSwift, and Realm. To add one:

  1. Edit src/tools/classifyCycle.ts. Add an entry to PATTERNS with id, name, fixHint, and a match function.

  2. Add a test in src/tools/readTools.test.ts that asserts the new pattern fires against a representative memgraph fixture.

  3. Add a staticAnalysisHint entry in src/runtime/staticAnalysisHints.ts (the test in that file enforces 1:1 coverage with PATTERNS).

  4. Add a fixTemplate entry in src/runtime/fixTemplates.ts (same 1:1 coverage guard).

  5. Open a PR.

Support this project

If memorydetective saves you time, you can support continued development:

Every contribution helps keep this maintained and documented.

License

Apache 2.0. See LICENSE and NOTICE.

Permits commercial use, modification, distribution, patent use. Includes attribution clause via the NOTICE file.

Why "memorydetective"?

Hunting retain cycles in SwiftUI feels like detective work: you have a body (the leaked instance), a crime scene (the .memgraph), and a chain of suspects (the retain chain). The tool helps you read the evidence and name the killer. The brand follows the work.

Available Tools

42 tools
analyzeAbandonedMemoryDiff reference-tree class counts and classify abandoned-memory shapeA

[mg.memory] Compare two .memgraph snapshots on heap reference-tree class counts (NOT cycle list) and classify each class's growth shape. Surfaces the family of bugs the cycle-only diffMemgraphs misses: orphaned KVO observers, never-removed NotificationCenter handlers, caches that never evict, singleton-retained payloads, and the long tail of unknown-growth worth manual inspection.

Pair with the verify-fix loop: captureScenarioState({label:'before'}) -> ship fix -> captureScenarioState({label:'after'}) -> analyzeAbandonedMemory(beforePath, afterPath). Validated end-to-end on the notelet investigation where AVPlayerItem went 342 to 0 across a fix that was invisible in standard leaks output (leakCount: 0 both sides).

Returns growthByClass[] ranked by absolute delta, each entry tagged with classification (kvo-observer-orphaned, notificationcenter-observer-leaked, cache-too-aggressive, singleton-retains-payload, unknown-growth) + confidence tier + hint. The classifier escalates large co-occurrence growth: if NSKeyValueObservance grew, other large-delta classes are assumed to be the observed types being retained, classified as kvo-observer-orphaned with confidence scaling by delta size.

ParametersJSON Schema
NameRequiredDescriptionDefault
beforePathYesAbsolute path to the baseline `.memgraph` (the BEFORE snapshot). Use `captureScenarioState({ label: 'before' })` to produce one in the standard verify-fix flow.
afterPathYesAbsolute path to the post-fix `.memgraph` (the AFTER snapshot). Same workflow as `beforePath`, after applying the candidate fix.
topNNoCap on `growthByClass[]` length. Default 25, max 200. Classes are ranked by absolute instance-count delta descending.
classFilterNoOptional substring filter. When set, only classes whose name contains this substring are included in the response. Useful for verifying a specific class went to baseline without seeing the surrounding noise.
outputFormatNoResponse format. Omitted or `json` (default, preserves v1.8 behavior) returns JSON.stringify of the result. `markdown` renders a human-readable view of the same data. `both` returns both content items in one response, so a client can display markdown to the user and parse JSON for the agent loop without a second call. `verify-fix-table` (v1.10, applies to `analyzeAbandonedMemory` and `diffMemgraphs`) emits a focused 4-column markdown comparison table (Class | Before | After | Delta) of the actionable rows; other tools fall back to `markdown` for this value.

TDQS

A4.6/5.0
Behavior5/5

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

No annotations present, so description fully covers behavior: compares reference-tree counts (not cycles), classifies into specific categories with confidence scaling, and explains co-occurrence escalation logic. Output structure detailed.

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?

Well-structured with clear front-loading of purpose, but somewhat verbose with detailed examples and classification logic. Could be trimmed while retaining value.

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?

No output schema, but description thoroughly explains return structure (growthByClass array with classification, confidence, hint). Covers all necessary context for a complex memory analysis tool.

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% with descriptive parameter descriptions. The tool description does not add extra meaning beyond what's in the schema, so baseline of 3 is appropriate.

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 it compares two .memgraph snapshots on heap reference-tree class counts and classifies growth shapes, distinguishing it from diffMemgraphs which only handles cycles. The verb 'analyze' and resource 'abandoned memory' 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?

Explicit workflow provided: pair with verify-fix loop using captureScenarioState before/after, and a real validation example. Implicitly suggests when not to use (e.g., cycle-only bugs) by contrasting with diffMemgraphs.

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

analyzeAllocationsAnalyze allocations from a .trace bundleB

[mg.trace] Parse the allocations schema from a .trace recorded with the Allocations Instruments template. Returns per-category aggregates (cumulative bytes, allocation count, lifecycle = transient/persistent/mixed), top allocators by size and by count, and a one-liner diagnosis identifying the dominant allocator.

ParametersJSON Schema
NameRequiredDescriptionDefault
tracePathYesAbsolute path to a `.trace` bundle recorded with the Allocations template (`xcrun xctrace record --template Allocations --attach <app|pid>`).
topNNoReturn the top N allocators by aggregated size (default 15).
minBytesNoFilter out individual allocations smaller than this size in bytes (default 0). Use 1024 to focus on >1KB allocations.
outputFormatNoResponse format. Omitted or `json` (default, preserves v1.8 behavior) returns JSON.stringify of the result. `markdown` renders a human-readable view of the same data. `both` returns both content items in one response, so a client can display markdown to the user and parse JSON for the agent loop without a second call. `verify-fix-table` (v1.10, applies to `analyzeAbandonedMemory` and `diffMemgraphs`) emits a focused 4-column markdown comparison table (Class | Before | After | Delta) of the actionable rows; other tools fall back to `markdown` for this value.

TDQS

B3.4/5.0
Behavior2/5

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

No annotations are provided, so the description must fully convey behavioral traits. It states it 'parses' and 'returns' data, implying a non-destructive read operation, but does not mention side effects, permissions, or performance characteristics. The description lacks detail on what happens if the trace is malformed or incompatible.

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 description is a single sentence that efficiently captures the tool's purpose and return values. However, it is dense and could benefit from a more structured format (e.g., bullet points) for better readability.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description lists returned data (aggregates, top allocators, diagnosis) but does not explain the output structure in detail. With no output schema, the description should cover error conditions, prerequisites (e.g., trace must be from Allocations template), and how the diagnosis is formed. The tool is part of a large sibling set, but its niche is clear.

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 description coverage is 100%, so the schema already documents all parameters well. The description adds minor value by providing the xcrun command example for tracePath and clarifying outputFormat values, but does not significantly enhance understanding beyond the schema.

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?

Description clearly states it parses the 'allocations' schema from a .trace bundle recorded with the Allocations Instruments template. It distinguishes itself from siblings like analyzeMemgraph (which analyzes general heap) and analyzeMemoryFootprint (which focuses on footprint breakdown) by specifying the exact schema and template used.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for analyzing allocation data from a specific trace template, but does not explicitly state when to use this tool versus siblings like analyzeMemgraph, analyzeMemoryFootprint, or compareTracesByPattern. No when-not-to-use guidance is provided.

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

analyzeAnimationHitchesAnalyze animation hitches from a .trace bundleA

[mg.trace] Parse the animation-hitches schema from a .trace recorded with the Animation Hitches Instruments template. Returns hitch totals, by-type counts, longest hitches, and how many crossed the user-perceptible 100ms threshold.

ParametersJSON Schema
NameRequiredDescriptionDefault
tracePathYesAbsolute path to a `.trace` bundle recorded with the Animation Hitches template (`xcrun xctrace record --template 'Animation Hitches' --attach <app|pid>`).
topNNoReturn the top N longest hitches in the response (default 10).
minDurationMsNoFilter out hitches shorter than this duration in milliseconds. Apple categorizes hitches >100ms as user-perceptible, pass 100 to focus on those.
timeRangeMsNoOptional time-window filter. Only hitches whose `startNs` falls within `[startMs, endMs]` (milliseconds since recording start) are included. Use this to answer 'what hitches happened during this 5-second user-visible jank window?' without re-recording.
outputFormatNoResponse format. Omitted or `json` (default, preserves v1.8 behavior) returns JSON.stringify of the result. `markdown` renders a human-readable view of the same data. `both` returns both content items in one response, so a client can display markdown to the user and parse JSON for the agent loop without a second call. `verify-fix-table` (v1.10, applies to `analyzeAbandonedMemory` and `diffMemgraphs`) emits a focused 4-column markdown comparison table (Class | Before | After | Delta) of the actionable rows; other tools fall back to `markdown` for this value.

TDQS

A4/5.0
Behavior3/5

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

No annotations are provided, so the description bears full burden. It describes the tool as parsing and returning data, implying non-destructive behavior. However, it lacks explicit disclosure of behavioral traits such as read-only nature, performance characteristics, or any side effects, which would be helpful for an agent.

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 two sentences long, front-loads the key action and schema, and contains no redundant information. Every sentence adds value.

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 5 parameters, full schema coverage, and no output schema, the description adequately conveys the overall purpose and return shape. It could be enhanced by briefly noting the response format options (e.g., JSON/markdown) but is largely complete 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 description coverage is 100%, so the base is 3. The description adds overall behavioral context (what the tool returns) but does not add specific parameter semantics beyond what is already in the schema. The summary of return values is useful but not parameter-level detail.

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 that it parses the `animation-hitches` schema from a `.trace` bundle, enumerates the outputs (hitch totals, by-type counts, longest hitches, 100ms threshold crossing), and implicitly distinguishes itself from siblings like `analyzeHangs` or `analyzeTimeProfile` by its specific domain.

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 implies usage for animation hitch analysis from a specific `.trace` bundle recorded with the Animation Hitches template, providing clear context. However, it doesn't explicitly exclude other scenarios or compare directly with sibling tools, leaving some ambiguity about when to prefer this over others.

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

analyzeAppLaunchAnalyze cold/warm launch breakdownA

[mg.trace] Parse the app-launch schema from a .trace recorded with the App Launch Instruments template. Returns total launch time, launch type (cold/warm), per-phase breakdown (process-creation, dyld-init, ObjC-init, AppDelegate, first-frame), and the slowest phase.

ParametersJSON Schema
NameRequiredDescriptionDefault
tracePathYesAbsolute path to a `.trace` bundle recorded with the App Launch template (`xcrun xctrace record --template 'App Launch' --launch <bundleId>`).
outputFormatNoResponse format. Omitted or `json` (default, preserves v1.8 behavior) returns JSON.stringify of the result. `markdown` renders a human-readable view of the same data. `both` returns both content items in one response, so a client can display markdown to the user and parse JSON for the agent loop without a second call. `verify-fix-table` (v1.10, applies to `analyzeAbandonedMemory` and `diffMemgraphs`) emits a focused 4-column markdown comparison table (Class | Before | After | Delta) of the actionable rows; other tools fall back to `markdown` for this value.

TDQS

A4/5.0
Behavior3/5

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

No annotations are present, so the description carries full burden. It describes parsing and returning data but does not explicitly state whether the operation is read-only, or disclose side effects, error handling, or limitations. However, the name 'analyze' suggests non-destructive behavior, and the description is adequate for an analysis 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 two sentences long, front-loaded with the action ('Parse the app-launch schema') and followed by a list of returned data. Every word is informative with no 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 has only two parameters, no output schema, and no annotations, the description adequately covers purpose, input requirements, and output contents. It is missing error conditions or usage examples, but for a focused analysis tool it is largely complete.

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 description coverage is 100%, so baseline is 3. The description adds minimal value beyond the schema for 'tracePath' (same info) and some added context for 'outputFormat' (default behavior and special case for other tools). Overall, it does not significantly enhance parameter understanding.

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 uses specific verbs ('Parse', 'Returns') and explicitly names the resource ('app-launch schema from a .trace recorded with the App Launch Instruments template'). It clearly distinguishes from siblings like 'analyzeAllocations' by specifying the template. The output contents (total launch time, type, per-phase breakdown, slowest phase) are detailed.

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 clearly states the input must be a .trace file recorded with the App Launch template, providing clear context. It does not explicitly state when not to use this tool or list alternatives, but the sibling tool names imply each analyze tool targets a specific template.

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

analyzeEnergyImpactAnalyze energy use / battery drain from an Energy Log traceA

[mg.trace] Parse the energy-impact schema from a .trace recorded with an Energy Log template. Returns per-sample bucket classification (idle / passive / active / high), aggregate wakeup count, active-state ratio, top-N samples by energy cost. The 'why is my app draining battery?' investigation. Distinct from analyzeTimeProfile (CPU sampling); reads the OS power-management subsystem directly. v1.15+.

ParametersJSON Schema
NameRequiredDescriptionDefault
tracePathYesAbsolute path to a `.trace` bundle recorded with an Energy Log template that includes the energy-impact instrument.
topNNoReturn the top N samples ranked by energy cost descending (default 10).
outputFormatNoResponse format. Omitted or `json` (default, preserves v1.8 behavior) returns JSON.stringify of the result. `markdown` renders a human-readable view of the same data. `both` returns both content items in one response, so a client can display markdown to the user and parse JSON for the agent loop without a second call. `verify-fix-table` (v1.10, applies to `analyzeAbandonedMemory` and `diffMemgraphs`) emits a focused 4-column markdown comparison table (Class | Before | After | Delta) of the actionable rows; other tools fall back to `markdown` for this value.

TDQS

A3.8/5.0
Behavior3/5

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

With no annotations, the description carries full burden. It discloses that it parses the trace, returns bucket classification, wakeup count, active-state ratio, and top-N samples. It mentions v1.15+ but does not specify side effects or error handling. Lacks explicit read-only statement, but the nature of trace analysis implies no destructive actions.

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 description is relatively concise and front-loaded with the core purpose. It uses brackets to highlight the tool source, and includes version info. Every sentence adds value, though it could be slightly more structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

No output schema exists, so the description must explain return values. It lists returned items (classification, wakeup count, ratio, top-N) but lacks details on format or structure. For a tool with 3 parameters, this is adequate but not fully complete.

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% with descriptions for all three parameters. The description adds context like 'top-N samples by energy cost' but does not provide additional semantic value beyond what the schema already offers. Baseline 3 is appropriate.

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 parses the energy-impact schema, returns classification and aggregate data, and distinguishes itself from analyzeTimeProfile by specifying it reads the OS power-management subsystem directly. The verb 'Parse' and resource 'energy-impact schema' 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 Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly mentions the use case 'why is my app draining battery?' and distinguishes from analyzeTimeProfile. However, it does not provide guidance on when not to use or alternative tools among the many siblings, but the single distinction is clear.

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

analyzeHangsAnalyze potential hangs from a .trace bundleA

[mg.trace] Run xcrun xctrace export against a .trace bundle for the potential-hangs schema and return aggregated stats (Hang vs Microhang counts, longest, average, total duration) plus the top N longest hangs sorted by duration. Use minDurationMs: 250 to filter to user-visible hangs only. Pass topFramesByHangStartNs: { '<startNs>': '<topFrame>' } to enrich each top hang with a mainThreadViolations[] field that classifies the kind of work blocking the main thread (sync-io, db-lock, network, lock-contention). The map keys are stringified startNs values; the typical pipeline is to call analyzeTimeProfile separately on the same trace, correlate samples to the hang windows by timestamp, then re-call analyzeHangs with the resulting map.

ParametersJSON Schema
NameRequiredDescriptionDefault
tracePathYesAbsolute path to a `.trace` bundle (output of `xctrace record` with the Time Profiler or Hangs template).
topNNoReturn the top N longest hangs in the response (default 10).
minDurationMsNoFilter out hangs shorter than this duration in milliseconds (default 0, include all). Use 250 to focus on 'real' hangs only.
timeRangeMsNoOptional time-window filter. Only hangs whose `startNs` falls within `[startMs, endMs]` (milliseconds since recording start) are included. Use this to answer 'what hangs happened between t=2s and t=7s?' without re-recording.
topFramesByHangStartNsNoOptional supplemental map from a hang's `startNs` (as a string) to the top frame seen during that hang. When provided, each matching hang in `top[]` is enriched with `mainThreadViolations[]` that catalog the kind of work happening on the main thread (sync-io, db-lock, network, lock-contention). Typical pipeline: call `analyzeTimeProfile` separately on the same `.trace`, correlate samples to hang windows by timestamp, then re-call `analyzeHangs` with the resulting map. Omit to skip the enrichment. SUPERSEDED in v1.12 by `includeStackClassification: true`, which builds this map internally.
includeStackClassificationNov1.12+. When true, analyzeHangs internally exports the `time-profile` schema in parallel with `potential-hangs`, correlates samples to hang windows by timestamp, picks the dominant top frame per hang, and runs `classifyHangFrame` on it. The `mainThreadViolations[]` field on each top hang is populated automatically. Replaces the v1.9 caller-built `topFramesByHangStartNs` map: most callers should set this flag instead of building the map manually. Adds a second xctrace export call, run in parallel with the hangs export so wall-clock is unchanged when the trace export succeeds. Falls back gracefully (empty violations, no error) when the time-profile schema is absent or xctrace SIGSEGVs on it.
outputFormatNoResponse format. Omitted or `json` (default, preserves v1.8 behavior) returns JSON.stringify of the result. `markdown` renders a human-readable view of the same data. `both` returns both content items in one response, so a client can display markdown to the user and parse JSON for the agent loop without a second call. `verify-fix-table` (v1.10, applies to `analyzeAbandonedMemory` and `diffMemgraphs`) emits a focused 4-column markdown comparison table (Class | Before | After | Delta) of the actionable rows; other tools fall back to `markdown` for this value.

TDQS

A5/5.0
Behavior5/5

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

Despite no annotations, the description transparently explains the tool's behavior: it runs xctrace export for potential-hangs schema, and optionally exports time-profile schema in parallel when includeStackClassification is true, with graceful fallback. It also describes the enrichment process and the effect of parameters.

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 focused paragraph that is well-structured: starts with the core purpose and then systematically details parameters and usage. Every sentence adds value, with no fluff.

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?

Without an output schema, the description fully explains the return values (aggregated stats and top N hangs with optional enrichment). It covers all parameters, including the newer includeStackClassification and outputFormat, and mentions fallback behavior, making it complete for the tool's functionality.

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

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, but the description adds significant meaning beyond the schema by explaining the pipeline for topFramesByHangStartNs, the recommendation for minDurationMs, and the behavior of includeStackClassification and outputFormat options.

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 analyzes potential hangs from .trace bundles by running xctrace export and returning aggregated stats and top hangs. It distinguishes from siblings like analyzeTimeProfile by focusing specifically on hang analysis.

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?

Provides explicit guidance on when to use parameters: suggests minDurationMs:250 for user-visible hangs, explains the typical pipeline with analyzeTimeProfile, and clarifies that includeStackClassification supersedes topFramesByHangStartNs for most callers.

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

analyzeLeakTimelineAnalyze leaks as a time series (xctrace Leaks instrument)A

[mg.trace] Parse the leaks schema from a .trace recorded with a Leaks template. Distinct from leaks(1) CLI (snapshot): this is a time series of leak events captured throughout the recording. Returns per-class first-seen-at timestamp, peak instance count, peak bytes, event count. Useful for answering 'when in the timeline did the leak appear?' which the snapshot CLI cannot. v1.15+.

ParametersJSON Schema
NameRequiredDescriptionDefault
tracePathYesAbsolute path to a `.trace` bundle recorded with a Leaks template.
topNNoReturn the top N leaked classes ranked by peak instance count (default 10).
outputFormatNoResponse format. Omitted or `json` (default, preserves v1.8 behavior) returns JSON.stringify of the result. `markdown` renders a human-readable view of the same data. `both` returns both content items in one response, so a client can display markdown to the user and parse JSON for the agent loop without a second call. `verify-fix-table` (v1.10, applies to `analyzeAbandonedMemory` and `diffMemgraphs`) emits a focused 4-column markdown comparison table (Class | Before | After | Delta) of the actionable rows; other tools fall back to `markdown` for this value.

TDQS

A4/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full burden for behavioral disclosure. It clarifies that the tool parses a trace file and returns analysis results, implying a read-only operation. However, it does not explicitly address error handling (e.g., invalid trace path, missing leaks data), performance implications, or required permissions. The behavioral information is adequate but not comprehensive.

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 exceptionally concise: three sentences plus a version note. It front-loads the core action ('Parse the leaks schema from a .trace'), immediately distinguishes from alternatives, lists outputs, and gives a concrete use case. Every sentence is essential and no information is repeated or wasted.

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 has 3 parameters, no output schema, and no annotations, the description provides a solid overview of purpose, output, and differentiation. It describes what the tool returns (four specific metrics), which partially compensates for the missing output schema. However, it does not cover possible errors, performance when processing large traces, or the exact format of timestamps, leaving minor gaps.

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 description coverage is 100%, so the schema already documents each parameter. The description adds value by explaining the return shape (per-class first-seen-at, peak counts), which helps contextualize the 'topN' parameter. However, it does not elaborate further on the parameters beyond their schema descriptions. With full schema coverage, this is a baseline score.

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 it parses the 'leaks' schema from a .trace recorded with a Leaks template, distinguishes it from the leaks(1) CLI snapshot by emphasizing it's a time series, and specifies the exact outputs (per-class first-seen-at timestamp, peak instance count, peak bytes, event count). This makes the purpose unambiguous and distinguishes it from sibling tools like analyzeAbandonedMemory or detectLeaksInXCTest.

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 contrasts this tool with the leaks(1) CLI snapshot and provides a concrete use case: answering 'when in the timeline did the leak appear?' which the snapshot cannot. However, it does not explicitly state when not to use this tool or compare it to sibling tools within the same suite (e.g., analyzeMemgraph), but the context is sufficient for an AI agent to infer appropriate usage.

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

analyzeMemgraphAnalyze a .memgraph fileA

[mg.memory] Run leaks(1) against a .memgraph file (exported from Xcode Memory Graph Debugger) and return a structured summary: header info, totals, top-level ROOT CYCLE blocks with chain length, plain-English diagnosis. Set fullChains: true to also include the full nested retain forest.

Pipeline: → classifyCycle (named-antipattern + fix hint) → reachableFromCycle (scope blame to a single root). The response includes suggestedNextCalls so the agent can chain without re-reasoning.

ParametersJSON Schema
NameRequiredDescriptionDefault
pathYesAbsolute path to a `.memgraph` file (export from Xcode Memory Graph Debugger).
fullChainsNoWhen true, include the full nested retain chains in the response. Default false returns only top-level ROOT CYCLE summaries to keep payloads small.
verbosityNoClass-name verbosity. `compact` (default) drops module prefixes, collapses nested SwiftUI ModifiedContent into `+N modifiers`, and truncates deep generics with a hash placeholder. `normal` keeps more detail. `full` returns Swift demangled names verbatim.compact
maxClassesInChainNoCap on how many unique class names to surface per cycle's `classesInChain` array. Default 10, enough to identify app-level types without flooding the response.
referenceTreeTopNNoWhen `leakCount` is 0 (the typical abandoned-memory case), also run `leaks --referenceTree --groupByType --noContent` and surface the top N classes by live instance count in `abandonedMemoryTop[]`. Set to 0 to skip the second leaks invocation. Default 20.
outputFormatNoResponse format. Omitted or `json` (default, preserves v1.8 behavior) returns JSON.stringify of the result. `markdown` renders a human-readable view of the same data. `both` returns both content items in one response, so a client can display markdown to the user and parse JSON for the agent loop without a second call. `verify-fix-table` (v1.10, applies to `analyzeAbandonedMemory` and `diffMemgraphs`) emits a focused 4-column markdown comparison table (Class | Before | After | Delta) of the actionable rows; other tools fall back to `markdown` for this value.

TDQS

A4.6/5.0
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 the use of `leaks(1)`, the output structure, pipeline steps, and behavior of parameters like `fullChains` and `referenceTreeTopN`. However, it doesn't explicitly state that the tool is non-destructive or any authorization requirements, though the nature of the tool implies safety.

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 concise and well-structured: it starts with the main purpose, then details the pipeline, and finally explains parameters. Every sentence adds value without repetition, making it easy for an agent to parse quickly.

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?

Given the tool's complexity with 6 parameters and no output schema, the description provides a thorough explanation of the output (header, totals, ROOT CYCLE blocks, diagnosis) and the pipeline. It also mentions `suggestedNextCalls`, ensuring the agent can chain tools effectively.

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

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, but the description adds significant context beyond the schema. It explains the purpose of each parameter, such as what `fullChains` does, the meaning of `verbosity` levels, the function of `maxClassesInChain`, and the `outputFormat` options. This added value justifies a high score.

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 runs `leaks(1)` against a `.memgraph` file and returns a structured summary, specifying the verb, resource, and output format. It distinguishes from siblings like `analyzeAbandonedMemory` by focusing on memory graph debugging.

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 (for analyzing .memgraph files) and outlines the pipeline with `classifyCycle` and `reachableFromCycle`, including `suggestedNextCalls` for chaining. It could be more explicit about when not to use it versus alternatives, but the context of sibling tools provides sufficient guidance.

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

analyzeMemoryFootprintAnalyze process VM footprint (resident / dirty / virtual)A

[mg.trace] Parse the memory-footprint schema from a .trace recorded with Allocations or System Trace template. Returns peak resident bytes (RAM in use), peak dirty bytes (the OOM-kill discriminator on iOS), peak VM regions, per-sample timeline. Distinct from analyzeAllocations (cumulative malloc bytes by category). Use when investigating 'why is my app getting jetsam-killed?'. v1.15+.

ParametersJSON Schema
NameRequiredDescriptionDefault
tracePathYesAbsolute path to a `.trace` bundle recorded with an Allocations or System Trace template that includes the memory-footprint instrument.
topNNoReturn the top N memory snapshots ranked by resident bytes (default 10).
outputFormatNoResponse format. Omitted or `json` (default, preserves v1.8 behavior) returns JSON.stringify of the result. `markdown` renders a human-readable view of the same data. `both` returns both content items in one response, so a client can display markdown to the user and parse JSON for the agent loop without a second call. `verify-fix-table` (v1.10, applies to `analyzeAbandonedMemory` and `diffMemgraphs`) emits a focused 4-column markdown comparison table (Class | Before | After | Delta) of the actionable rows; other tools fall back to `markdown` for this value.

TDQS

A4/5.0
Behavior3/5

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

With no annotations, description carries burden. It describes outputs and version info but omits side effects, authentication needs, or read-only nature. Adequate but not explicit.

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?

Four sentences, each providing distinct value. Front-loaded with specific verb and resource, no 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 no output schema, description covers key return values and dependencies. Missing error handling or prerequisites beyond trace path, but 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 100% with detailed parameter descriptions. Description adds context about trace template requirements and outputFormat defaults, but doesn't significantly exceed schema info.

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?

Description clearly states the tool parses memory-footprint schema from .trace files, returning specific metrics (peak resident, dirty, VM regions, timeline), and distinguishes from sibling tool analyzeAllocations.

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?

Explicitly says when to use ('why is my app getting jetsam-killed?') and distinguishes from analyzeAllocations. Lacks explicit 'when not to use' or conditions where other tools would be more appropriate.

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

analyzeMetricKitPayloadAnalyze a .mxdiagnostic payload from MetricKit (production diagnostics)A

[mg.production] Parse Apple MetricKit .mxdiagnostic payloads from real-device TestFlight / App Store builds. Aggregates crashes (clustered by exception type / binary / top frame), hang hotspots (sorted by duration, with localized-string handling for hangDuration), CPU exceptions, and disk-write exceptions. Inputs: payloadPath (single file), payloadDir (aggregate across files), or payloadJson (raw). Each output entry includes the raw binaryUUID + offset for downstream dSYM symbolication. Returns 3 most-actionable sections + cross-tool chain hints (e.g. objc_release top frame -> findCycles, sqlite top frame -> analyzeHangs with main-thread-violation classifier). No symbolication in v1; that's a separate tool. Simulator does NOT generate MetricKit payloads (Apple-side limitation) — frame this as post-mortem analysis. New in v1.18.

ParametersJSON Schema
NameRequiredDescriptionDefault
payloadPathNoAbsolute path to a single `.mxdiagnostic` file (the JSON Apple's MetricKit writes to the app's MetricKit directory on real-device builds).
payloadDirNoAbsolute path to a directory containing one or more `.mxdiagnostic` files. The tool walks the dir non-recursively and aggregates findings across all payloads.
payloadJsonNoRaw `.mxdiagnostic` JSON string. For in-memory callers and tests; if both `payloadPath` and `payloadJson` are provided, `payloadJson` wins.
topNNoCap on `crashCluster[]` / `hangHotspots[]` / `cpuExceptions[]` / `diskWriteExceptions[]` length. Default 10.
groupByNoClustering key for `crashCluster[]`. `exception-type` groups by exceptionType + signal (catches mass-crash on the same OS-level fault). `binary` groups by the top frame's binary name (catches crashes localized to one dylib/framework). `top-frame` groups by binary + offset (the most granular). Default `exception-type`.exception-type

TDQS

A4.6/5.0
Behavior4/5

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

The description discloses aggregation logic, raw binaryUUID+offset inclusion, localized-string handling, and limitations (no symbolication, simulator limitation). However, it does not explicitly state that the tool is read-only or has no side effects. With no annotations, this is a minor gap.

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 description is relatively long but well-structured, with each sentence providing useful context. A minor reduction could improve conciseness, but it remains effective 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?

The description covers input parameters, output structure (three sections, raw binaryUUID+offset, cross-tool hints), and limitations. It does not detail error handling or invalid payloads, but given the complexity, it provides sufficient completeness for effective use.

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

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema covers all 5 parameters (100% coverage). The description adds significant value by explaining the behavior of each parameter, such as the precedence rule for payloadJson over payloadPath, aggregation behavior of payloadDir, and detailed explanation of groupBy enum options with clustering criteria.

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 parses Apple MetricKit .mxdiagnostic payloads from production builds, aggregates crashes, hang hotspots, CPU exceptions, and disk-write exceptions, and returns three actionable sections with cross-tool chaining hints. It distinguishes from sibling tools like analyzeHangs and findCycles by providing specific hints on when to use them.

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 explicitly states that simulator does not generate MetricKit payloads, so it should be framed as post-mortem analysis. It also clarifies that symbolication is a separate tool and provides cross-tool chaining hints, guiding the agent on when to use this tool versus others.

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

analyzeNetworkActivityAnalyze HTTP / connection activity from a Network traceA

[mg.trace] Parse the network-connections schema from a .trace recorded with a Network template. Returns per-request URL/host, method, status code, response time, bytes in/out. Top-N rankings by duration (which calls blocked the user) and by bytes (which calls bloat the budget) plus per-host aggregates surfacing chatty SDKs. v1.14+.

ParametersJSON Schema
NameRequiredDescriptionDefault
tracePathYesAbsolute path to a `.trace` bundle recorded with a Network template (`xcrun xctrace record --template 'Network Profile' --attach <app|pid>`).
topNNoReturn the top N rows for each ranking dimension (by-duration + by-bytes). Default 10.
minBytesNoFilter out connections that transferred fewer than this many bytes (in + out combined). Useful for cutting tiny pings out of the by-bytes view.
outputFormatNoResponse format. Omitted or `json` (default, preserves v1.8 behavior) returns JSON.stringify of the result. `markdown` renders a human-readable view of the same data. `both` returns both content items in one response, so a client can display markdown to the user and parse JSON for the agent loop without a second call. `verify-fix-table` (v1.10, applies to `analyzeAbandonedMemory` and `diffMemgraphs`) emits a focused 4-column markdown comparison table (Class | Before | After | Delta) of the actionable rows; other tools fall back to `markdown` for this value.

TDQS

A4.1/5.0
Behavior4/5

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

With no annotations, the description carries the full behavioral burden. It explains the tool parses a specific schema, returns per-request data and aggregates, and notes version requirements. This sets accurate expectations for the tool's operation.

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 description is a single paragraph but packs significant detail without redundancy. Each sentence contributes meaning, though it could be slightly more concise.

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 no output schema, the description covers input requirements, processing, and output structure (per-request details, aggregates). It explains version constraints and parameter functions. However, it lacks differentiation from sibling tools.

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 provides full coverage (100%) and descriptions for all 4 parameters. The description adds context about the trace template and version (v1.14+), enhancing understanding beyond the schema alone.

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 it parses network trace data, returns per-request details (URL, method, etc.), and provides top-N rankings and per-host aggregates. It specifically names the trace template and schema, distinguishing it from sibling tools.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies use when analyzing network activity from a trace, but lacks explicit guidance on when to use this tool versus other analysis tools (e.g., analyzeTimeProfile). No when-not-to or alternative suggestions.

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

analyzeTimeProfileAnalyze a Time Profiler traceA

[mg.trace] Export the time-profile schema from a .trace bundle and return top symbols by sample count. Note: heavy/unsymbolicated traces may crash xctrace export — when that happens, the tool returns a notice field with workarounds (open in Instruments first to symbolicate, or re-record shorter).

ParametersJSON Schema
NameRequiredDescriptionDefault
tracePathYesAbsolute path to a `.trace` bundle.
topNNoReturn the top N hottest stacks by sample count (default 20).
outputFormatNoResponse format. Omitted or `json` (default, preserves v1.8 behavior) returns JSON.stringify of the result. `markdown` renders a human-readable view of the same data. `both` returns both content items in one response, so a client can display markdown to the user and parse JSON for the agent loop without a second call. `verify-fix-table` (v1.10, applies to `analyzeAbandonedMemory` and `diffMemgraphs`) emits a focused 4-column markdown comparison table (Class | Before | After | Delta) of the actionable rows; other tools fall back to `markdown` for this value.

TDQS

A3.9/5.0
Behavior4/5

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

Discloses that heavy/unsymbolicated traces may crash and describes the returned notice field with workarounds. With no annotations, this provides useful behavioral context, though permissions or other side effects are omitted.

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?

Two concise sentences: the first states the core operation, the second provides a critical caveat. No unnecessary words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Lacks a description of the normal return structure beyond 'top symbols by sample count'. Without an output schema, more detail on the response format would improve completeness.

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 covers 100% of parameters with descriptions. The first sentence reinforces the meaning of topN, but adds minimal new meaning beyond the schema.

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 explicitly states the action (export time-profile schema and return top symbols) and the resource (.trace bundle). It distinguishes from sibling tools by focusing on time-profile analysis.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit guidance on when to use this tool versus alternatives like analyzeMemgraph. The context is implied but not comparative.

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

bootAndLaunchForLeakInvestigationBuild, boot, install, and launch an iOS app for leak investigationA

[mg.build] Single-call orchestration that runs xcodebuild build (optional), boots the iOS Simulator, installs the .app, and launches it with MallocStackLogging=1 propagated via SIMCTL_CHILD_*. Required because leaks --outputGraph regressed on macOS 26.x and only works when the target was launched with malloc-stack-logging in its environment. Returns the host PID + simulator UDID + bundle id ready to chain into captureMemgraph. Auto-discovers BUILT_PRODUCTS_DIR, WRAPPER_NAME, EXECUTABLE_NAME, and PRODUCT_BUNDLE_IDENTIFIER from xcodebuild -showBuildSettings -json. Required: scheme and exactly one of workspace or project.

ParametersJSON Schema
NameRequiredDescriptionDefault
workspaceNoAbsolute path to a .xcworkspace. Mutually exclusive with `project`.
projectNoAbsolute path to a .xcodeproj. Mutually exclusive with `workspace`.
schemeYesXcode scheme that builds the iOS application bundle.
configurationNoxcodebuild configuration. Default "Debug".Debug
bundleIdNoOverride the bundle identifier. By default it is discovered from `xcodebuild -showBuildSettings`.
derivedDataPathNoCustom -derivedDataPath. Useful to avoid collisions when multiple investigations run in parallel.
simulatorNoPick a simulator by `udid`, by `name` (with optional `os`), or omit to use whichever simulator is currently booted.
envVarsNoExtra env vars to apply to the launched app (propagated via SIMCTL_CHILD_*). Default already includes MallocStackLogging=1.
launchArgsNoExtra arguments passed to the app on launch.
buildBeforeLaunchNoRun `xcodebuild build` before installing. Set false when you've already built and want to skip straight to install/launch.
warmupSecondsNoHow long to wait after launch before resolving the host PID. Default 3 seconds.

TDQS

A4.6/5.0
Behavior5/5

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

With no annotations provided, the description fully carries the burden. It discloses all key behaviors: optional build, simulator boot, app install and launch with environment variable propagation, auto-discovery of build settings, and the returned data. No contradictions or omissions are apparent.

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 description is a single dense paragraph that front-loads the purpose. It is relatively concise for a complex tool with 11 parameters, though it could benefit from bullet points or clearer separation of logical sections to aid readability. No extraneous information is present.

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?

Given the complexity (11 parameters, nested objects, no output schema), the description adequately covers return values (host PID, simulator UDID, bundle ID) and explains how the tool chains into `captureMemgraph`. It also mentions auto-discovery, fulfilling the contextual needs for an agent to use it effectively.

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?

The input schema covers 100% of parameters with descriptions. The description adds extra meaning for several parameters, such as the default `MallocStackLogging=1` for `envVars` and the conditional use of `buildBeforeLaunch`. This goes beyond the schema alone, justifying a score above baseline.

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 what the tool does: orchestrates build, boot, install, and launch of an iOS app with MallocStackLogging=1 for leak investigation. It specifies the verb 'orchestration' and the resource 'iOS app', distinguishing it from sibling tools that analyze leaks rather than prepare the environment.

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 why this tool is needed (regression in `leaks --outputGraph` on macOS 26.x) and that it is a prerequisite for `captureMemgraph`. It provides context on when to use it, but does not explicitly state when not to use it or mention alternatives among siblings.

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

captureMemgraphCapture a .memgraph from a running processA

[mg.memory] Wrapper around leaks --outputGraph. Resolves appName to a PID via pgrep -x (or accepts pid directly), then writes a .memgraph snapshot. Limitation: only works for processes running on the local Mac (Mac apps + iOS simulator). Does NOT work for physical iOS devices, use Xcode's Memory Graph button there.

ParametersJSON Schema
NameRequiredDescriptionDefault
pidNoPID of the running process. Mutually exclusive with `appName`.
appNameNoApp name (resolves to PID via `pgrep -x`). Mutually exclusive with `pid`.
outputYesAbsolute path where the `.memgraph` should be written. Must end in `.memgraph`.

TDQS

A4.7/5.0
Behavior4/5

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

Describes the underlying command (leaks), resolution via pgrep, and the write action. Lacks details on side effects (e.g., process pause) or error handling, but with no annotations, this is a solid disclosure.

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?

Single concise paragraph front-loading purpose and key mechanics. Every sentence adds value; no redundancy.

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?

Given no output schema and no annotations, the description fully covers purpose, parameter usage, constraints, and limitations. Provides complete guidance for an agent.

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 already documents all 3 parameters with 100% coverage. Description adds valuable context: mutual exclusivity of pid and appName, resolution via pgrep, and implicit output extension requirement.

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?

Clearly states it captures a .memgraph from a running process using `leaks --outputGraph`. Distinguishes from sibling tools like analyzeMemgraph or diffMemgraphs by focusing on capture.

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?

Explicitly notes it only works on local Mac and iOS simulator, not physical devices, and directs users to Xcode's Memory Graph button for that case. Provides clear when-to-use/when-not-to-use guidance.

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

captureScenarioStateCapture a labeled before/after snapshot for verify-fixA

[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.

ParametersJSON 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.

TDQS

A4.2/5.0
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.

classifyCycleClassify ROOT CYCLEs against known patternsA

[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 patternId, confidence, and a fixHint per cycle.

Pipeline: this is the killer tool — after the result, follow suggestedNextCalls which pre-translates each match to a Swift regex (swiftSearchPattern) + the captured class name (swiftGetSymbolDefinition). Discovery is data, not inference.

ParametersJSON Schema
NameRequiredDescriptionDefault
pathYesAbsolute path to a `.memgraph` file.
maxResultsNoCap on classifications returned (default 20).

TDQS

A3.7/5.0
Behavior2/5

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

No annotations are provided, so the description must disclose behavioral traits. It only states what the tool returns and its pipeline role, but does not mention whether it is read-only, destructive, or requires specific permissions. For a mutation-like analysis tool, this is a gap.

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 description is two paragraphs: first defines functionality, second guides pipeline usage. It is efficient but contains jargon; a slightly more structured format could improve clarity.

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?

The description lists return fields and pipeline connections, compensating for the lack of output schema. However, it does not detail the structure of the return values beyond names, which may be sufficient given the context.

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?

The input schema covers 100% of parameters with descriptions. The description adds no extra parameter information beyond listing return fields, so it meets the baseline but does not exceed it.

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 matches each ROOT CYCLE against a catalog of 8 known antipatterns, using specific verbs like 'Match' and 'Returns'. It distinguishes itself from sibling tools like findCycles by focusing on classification against patterns, not just cycle detection.

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 provides explicit instructions on what to do after using the tool ('follow suggestedNextCalls') and hints at a pipeline context. However, it does not specify when not to use this tool or directly compare to alternatives among the many siblings.

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

cleanupTracesPreview and delete `.trace` bundles under TRACE_ROOTA

[ops] Triage and clean up .trace bundles produced by recordTimeProfile. Each bundle is typically tens to hundreds of MB; after a few sessions the trace root fills up fast and v1.8 had no built-in cleanup.

Default-safe: dryRun: true by default. The tool returns the list of candidates with path, sizeMB, and ageDays (sorted oldest-first) but deletes nothing. Pass dryRun: false only when the user has reviewed the candidates and authorized deletion.

Scope: restricted to MEMORYDETECTIVE_TRACE_ROOT by default. To clean up an arbitrary directory, pass root: <path> AND set MEMORYDETECTIVE_ALLOW_EXTERNAL_CLEANUP=1 in the env. Without the env var the tool returns ok: false with the failure reason and deletes nothing; destructive disk operations outside the configured boundary are default-deny.

Recursion boundary: the tool walks subdirectories looking for *.trace directories, but stops at the .trace boundary (does NOT descend INTO bundles). xctrace writes structured content inside (Run1, Form1.template, etc.) that must not be treated as nested bundles.

Use olderThanDays: N to keep recent traces and only target stale ones (e.g. older than 7 days). Omit to consider all bundles regardless of age.

ParametersJSON Schema
NameRequiredDescriptionDefault
olderThanDaysNoOnly consider `.trace` bundles whose modification time is older than this many days. Omit to consider all traces under the root regardless of age.
dryRunNoWhen `true` (default), the tool returns the list of candidates without deleting. Pass `false` to actually delete. The default-to-true means an accidental call previews instead of destroying.
rootNoDirectory to scan. Defaults to `MEMORYDETECTIVE_TRACE_ROOT`. If the resolved path is outside the configured trace root, the tool requires `MEMORYDETECTIVE_ALLOW_EXTERNAL_CLEANUP=1` in the environment to proceed.
outputFormatNoResponse format. Omitted or `json` (default, preserves v1.8 behavior) returns JSON.stringify of the result. `markdown` renders a human-readable view of the same data. `both` returns both content items in one response, so a client can display markdown to the user and parse JSON for the agent loop without a second call. `verify-fix-table` (v1.10, applies to `analyzeAbandonedMemory` and `diffMemgraphs`) emits a focused 4-column markdown comparison table (Class | Before | After | Delta) of the actionable rows; other tools fall back to `markdown` for this value.

TDQS

A4.4/5.0
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 clearly states the tool's safe default (dryRun true), its destructive nature when dryRun false, scope restrictions, recursion boundary, and the condition for external cleanup. It could mention error handling or output on failure, but it already covers the key behavioral traits.

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 description is structured with clear sections (default-safe, scope, recursion boundary, usage) and front-loaded with a summary. While slightly verbose, each sentence contributes necessary context, and there is no redundant information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description explains the output includes candidates with path, sizeMB, and ageDays, and mentions ok: false for failures. However, it does not provide a complete picture of the response format, such as whether the list is ordered, or the exact structure of success/failure responses. Given no output schema, more explicit output documentation would improve completeness.

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?

The input schema has 100% description coverage, but the description adds significant value beyond the schema: it explains the safety rationale for dryRun default, the env var requirement for root, and the recursion boundary. This enriches the agent's understanding of parameter interactions.

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 title and description clearly state the tool's purpose: previewing and deleting .trace bundles under TRACE_ROOT. The verb 'cleanup' combined with 'Preview and delete' is specific and distinct from sibling tools which focus on analysis or capture.

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 provides explicit guidance on when to use the tool, including the safe default (dryRun: true), the need for user review before actual deletion, scope restrictions, and the env var requirement for external paths. It also mentions the olderThanDays filter to limit scope.

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

compareTracesByPatternCompare before/after .trace bundles for a perf regression targetA

[mg.trace][mg.ci] Trace-side counterpart to verifyFix. Compares two .trace bundles for a specific perf category (hangs, animation-hitches, or app-launch) and emits a PASS/PARTIAL/FAIL verdict plus before/after stats and deltas. Apply thresholds: hangs PASS when longest is below hangsMaxLongestMs (default 0); hitches PASS when longest is below hitchesMaxLongestMs (default 100ms — Apple's user-perceptible threshold); app-launch PASS when total is below appLaunchMaxTotalMs (default 1000ms).

Pipeline: capture before/after .trace (via recordTimeProfile or Xcode), then point this at the pair. The natural followup to a hangs/jank/launch fix PR.

ParametersJSON Schema
NameRequiredDescriptionDefault
beforeYesAbsolute path to the baseline `.trace` (pre-fix).
afterYesAbsolute path to the post-fix `.trace`.
categoryYesWhich perf category to verify. `hangs` parses the `potential-hangs` schema, `animation-hitches` parses `animation-hitches`, `app-launch` parses the launch breakdown.
thresholdsNo
hangsMinDurationMsNoFor `category: hangs` — only count hangs longer than this. Default 250ms (Apple's user-perceptible threshold for hangs).
hitchesMinDurationMsNoFor `category: animation-hitches` — only count hitches longer than this. Default 100ms (Apple's user-perceptible threshold).

TDQS

A4.3/5.0
Behavior4/5

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

With no annotations, the description carries the full burden. It discloses default thresholds, PASS conditions per category, and the verdict output. It does not state whether it is read-only or destructive, but the comparison nature suggests no side effects. No contradictions.

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 description is two paragraphs with key information front-loaded. It is fairly concise but includes some redundant detail (e.g., repeating thresholds). Still, it earns its keep.

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 many sibling tools, the description covers purpose, usage, thresholds, and pipeline adequately. It could be more explicit about the output format but is sufficient.

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 83%, but the description adds meaning beyond schema by explaining default values, condition for PASS, and how category affects parsing. It also clarifies the pipeline context (e.g., absolute paths).

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 explicitly states it compares two .trace bundles for a specific perf category and emits a PASS/PARTIAL/FAIL verdict, distinguishing it from siblings like verifyFix. The verb 'compares' and resource '.trace bundles' 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 Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context: it is the natural followup to a fix PR, and mentions the pipeline of capturing traces first. It does not explicitly exclude alternative tools but implies its role relative to verifyFix.

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

countAliveCount instances by classA

[mg.memory] Count how many times each class appears in a .memgraph's leaked nodes. Provide className (substring) for a single number, or omit it to get the top N most-leaked classes. Use this to confirm whether a fix actually reduced instance counts.

ParametersJSON Schema
NameRequiredDescriptionDefault
pathYesAbsolute path to a `.memgraph` file.
classNameNoOptional class name (substring). When provided, only that class's count is returned. When omitted, all class counts are returned.
topNNoWhen `className` is omitted, return the top N most-leaked classes (default 20).
includeReferenceTreeNov1.12+. When true, also parse `leaks --referenceTree --groupByType --noContent` output and surface heap-wide instance counts alongside the cycle-side counts. Required to find classes on memgraphs where `leakCount: 0` and the abandoned-memory shape is what's interesting (e.g. orphaned KVO observers reachable from the global registry). Adds a second `leaks` invocation, run in parallel. Default false preserves v1.11 behavior.
sortByNov1.14+. Ranks the topN by either instance count (default, preserves v1.13 behavior) or total bytes (FLEX's 'Size' sort). totalBytes is `count * instanceSizeBytes` and is the right rank for 'where is my memory going?' investigations vs 'how many instances are alive?'. Per-class instanceSizeBytes + totalBytes are returned regardless of sort key.count
excludeFrameworkNoiseNov1.17 B-10. When `includeReferenceTree: true`, populates `actionableCounts[]` with the framework-noise classes filtered out (NSMutableDictionary, CFString, __DATA __bss, dispatch_queue_t, etc.). Set false to disable the filter and surface the raw counts only via `counts[]`. The curated noise list is calibrated for abandoned-memory investigations; combine with `additionalNoisePatterns` / `unsuppressClassPatterns` to tune.
additionalNoisePatternsNov1.17 B-10. Extra regex patterns (one per string) added to the noise filter. Useful when your app's noise classes are not in the curated list (e.g. third-party SDK collection storage that scales with app activity). Patterns are matched case-sensitively against the class name.
unsuppressClassPatternsNov1.17 B-10. Regex patterns that override the noise filter. Use when the default filter false-positives an actionable class (e.g. your app's `NSMutableDictionary` subclass is the actual leak site, or you want CFString back on the actionable list for a string-budget investigation).
noiseAuditModeNov1.17 B-10. When true, returns an extra `noiseAudit[]` field listing each class that was filtered out, with the matching reason ('default-list', 'additional-pattern', or 'kept-by-unsuppress'). Lets the caller verify the filter is calibrated for their app before trusting `actionableCounts[]`.

TDQS

A3.6/5.0
Behavior2/5

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

Annotations are absent, so the description must carry full behavioral disclosure. It only states 'count instances' and mentions parameter behavior in passing but does not explain that the tool is read-only, return format, side effects, or permissions. The detailed versioning notes are in the schema, not the description.

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 two sentences: first defines purpose, second covers usage modes and a concrete use case. Concise and front-loaded with no wasted words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Despite high schema coverage, the description omits contextual details like output structure, error scenarios, or deeper explanation of 'leaked nodes'. For a tool with 9 parameters in a complex domain, more context is needed beyond the schema descriptions.

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 description coverage is 100%, so baseline is 3. The description references className and topN but adds little beyond the schema. No contradiction with schema.

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 counts class appearances in leaked nodes of a .memgraph file, with specific modes for single class or top N. It includes a use case ('confirm whether a fix actually reduced instance counts') and distinguishes from siblings by focusing on class counts in leaked memory.

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 gives explicit usage guidance: provide className for a single count or omit for top N, and use to verify fix effectiveness. However, it does not discuss alternatives or when not to use this tool, limiting full guideline completeness.

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

detectLeaksInXCTestRun an XCTest unit-test bundle with leak detection (CI-runnable)A

[mg.ci] Sibling to detectLeaksInXCUITest, targeting XCTest unit-test schemes. Build for testing, launch the test bundle with an optional -only-testing:<TestTarget>/<TestClass>[/<testMethod>] filter, poll for the runner process (xctest by default, configurable via processName for app-hosted test bundles), capture a baseline .memgraph once the runner appears, run the test to completion, capture an after .memgraph, and diff. Returns passed: false when new ROOT CYCLE blocks appear that are not in the allowlistPatterns list. Per-test granularity: call once per test method with different testCaseFilter values; aggregation is the caller's responsibility, keeping the response tied to a single, well-defined before/after pair. If the runner exits before the after-capture window (common for fast unit tests with no host), the response carries an explicit failureReason pointing at the tearDown workaround. Designed for CI gating: non-zero exit code on failure.

ParametersJSON Schema
NameRequiredDescriptionDefault
workspaceNoPath to the `.xcworkspace`. Mutually exclusive with `project`.
projectNoPath to the `.xcodeproj`. Mutually exclusive with `workspace`.
schemeYesXcode scheme that builds and runs the XCTest unit-test target.
destinationNoxcodebuild destination string. Default targets the most common iOS Simulator profile.platform=iOS Simulator,name=iPhone 11,OS=latest
testCaseFilterNoOptional `-only-testing` filter in `<TestTarget>/<TestClass>` or `<TestTarget>/<TestClass>/<testMethod>` form. Omit to run every test in the scheme (slower; produces one before/after pair for the entire run).
processNameNoProcess name to attach `leaks` against. `xctest` is the default unit-test runner on the simulator. If your tests are hosted in an app, pass the host app's process name instead (the same value `pgrep -x` would match).xctest
outputDirNoDirectory where the baseline + after `.memgraph` snapshots are written./tmp/memorydetective-xctest
allowlistPatternsNoSubstrings of class names that are allowed to leak. Cycles whose root class contains any of these substrings will not fail the run.
skipBuildNoSkip the `build-for-testing` step (faster on CI when the build is cached).
runnerStartTimeoutMsNoHow long to wait for the test runner process to appear under `pgrep -x <processName>` before giving up. Default 5 minutes.
outputHtmlPathNoAbsolute path to write a self-contained HTML report (inline CSS, no external assets). When set, the response also gains an `htmlReportPath` field pointing at the same file. Designed for CI artifact upload + PR-comment attachment.

TDQS

A4.4/5.0
Behavior5/5

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

With no annotations, the description fully discloses the tool's behavior: it builds for testing, launches with optional filter, polls for runner process, captures two memgraphs, diffs them, and returns false on new root cycles. It also details edge cases (early runner exit, allowlistPatterns, exit codes) and explains the processName parameter for app-hosted test bundles.

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 description is well-structured and front-loaded with the sibling relationship and target. Every sentence contributes value, though it is somewhat lengthy. It could be slightly more concise, but overall it efficiently conveys necessary information.

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?

Despite lacking an output schema, the description explains the return behavior (passed: false, failureReason, htmlReportPath) and exit code. It covers edge cases, per-test granularity, and caller responsibilities. Given the tool's complexity (11 parameters, many behavioral nuances), the description is remarkably complete.

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 description coverage is 100%, so the baseline is 3. The description does not add substantial new meaning beyond the schema descriptions; it contextualizes testCaseFilter for per-test usage and mentions processName customization, but these are already covered in the schema. No parameters lack explanation.

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 it runs XCTest unit-test bundles with leak detection, identifies itself as a sibling to detectLeaksInXCUITest, and explains the process (build, launch, capture memgraphs, diff). It distinguishes itself by targeting XCTest unit-test schemes rather than UI tests.

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 provides clear usage context: designed for CI gating, per-test granularity via testCaseFilter, aggregation responsibility on caller, and notes about fast unit tests with early runner exit. While it doesn't explicitly list when not to use or provide alternatives beyond the sibling mention, the guidance is sufficient for effective use.

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

detectLeaksInXCUITestRun an XCUITest with leak detection (CI-runnable)A

[mg.ci] Build the workspace for testing, launch the test cycle, capture a baseline .memgraph once the app appears, run the test to completion, capture an after .memgraph, and diff. Returns passed: false when new ROOT CYCLE blocks appear that aren't in the allowlistPatterns list. Designed for CI gating: non-zero exit code on failure.

ParametersJSON Schema
NameRequiredDescriptionDefault
workspaceYesPath to the .xcworkspace or .xcodeproj for the project.
schemeYesXcode scheme that builds and runs the XCUITest target.
testIdentifierYesXCUITest identifier in `<TestTarget>/<TestClass>/<testMethod>` form. Passed to `-only-testing` so we run exactly one test cycle.
appNameYesApp process name as it appears in `pgrep -x` (e.g. "DemoApp").
destinationNoxcodebuild destination string. Default targets the most common iOS Simulator profile.platform=iOS Simulator,name=iPhone 11,OS=latest
outputDirNoDirectory where the baseline + after `.memgraph` snapshots are written./tmp/memorydetective-xcuitest
allowlistPatternsNoSubstrings of class names that are allowed to leak. Examples: pre-existing SwiftUI internals you can't fix, third-party SDK leaks. Cycles whose root class contains any of these substrings won't fail the run.
skipBuildNoSkip the build-for-testing step (faster on CI when the build is already cached).
outputHtmlPathNoAbsolute path to write a self-contained HTML report (inline CSS, no external assets). When set, the response also gains an `htmlReportPath` field pointing at the same file. Designed for CI artifact upload + PR-comment attachment.

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations, the description effectively discloses key behaviors: building, launching, capturing baseline/after memgraphs, diffing, and returning pass/fail based on new root cycle blocks. It also explains the allowlist mechanism and CI gating exit code. Some side effects (like temp files in outputDir) are implicit but clear enough.

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 focused paragraph, immediately front-loaded with the CI tag. Every sentence adds value: it covers build, capture, diff, fail condition, allowlist usage, and exit code. 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?

Although there is no output schema, the description explains return behavior ('passed: false' on failure, non-zero exit code) and mentions the optional htmlReportPath field. It does not explicitly describe the success return value or other response fields, but for a 9-parameter tool this is adequate.

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% with good parameter descriptions. The tool description adds high-level context (e.g., why appName is needed for pgrep, what allowlistPatterns do) but does not go beyond the schema's own descriptions substantially. Baseline 3 is appropriate.

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 runs an XCUITest with leak detection, capturing two memgraphs and diffing them. It distinguishes from siblings like 'detectLeaksInXCTest' (which likely targets XCTest) and other analyze tools by specifying XCUITest+CI gating.

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 'Designed for CI gating: non-zero exit code on failure', implying usage in CI pipelines. However, it does not mention when not to use this tool or suggest alternatives like other memory analysis tools for non-test scenarios.

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

diffMemgraphsDiff two memgraph snapshotsA

[mg.memory] Compare a baseline .memgraph (before) against a comparison .memgraph (after). Returns total leak/byte deltas, classes whose counts increased or decreased, and ROOT CYCLE signatures bucketed into newInAfter / goneFromBefore / persisted. The killer feature for verifying that a fix actually worked.

ParametersJSON Schema
NameRequiredDescriptionDefault
beforeYesAbsolute path to the baseline `.memgraph` file.
afterYesAbsolute path to the comparison `.memgraph` file.
outputFormatNoResponse format. Omitted or `json` (default, preserves v1.8 behavior) returns JSON.stringify of the result. `markdown` renders a human-readable view of the same data. `both` returns both content items in one response, so a client can display markdown to the user and parse JSON for the agent loop without a second call. `verify-fix-table` (v1.10, applies to `analyzeAbandonedMemory` and `diffMemgraphs`) emits a focused 4-column markdown comparison table (Class | Before | After | Delta) of the actionable rows; other tools fall back to `markdown` for this value.

TDQS

A4/5.0
Behavior3/5

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

With no annotations, description should disclose behavior. It doesn't explicitly state it's read-only or handle errors, but the term 'compare' implies non-destructive. Lacks details on file requirements or side effects.

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?

Three front-loaded sentences convey purpose, outputs, and use case without unnecessary words. Efficient and structured.

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?

Explains return values (deltas, class changes, root cycles) adequately despite no output schema. Could be slightly more detailed about data structures, but sufficient for agent selection.

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?

All parameters are fully described in the schema (100% coverage). The description adds no additional explanation beyond what the schema provides, so baseline 3 applies.

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 it compares two .memgraph files and lists specific outputs (deltas, class changes, root cycles). It uniquely distinguishes from siblings by focusing on diffs, especially for verifying fixes.

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?

Implicitly indicates use when comparing baseline vs comparison snapshots, especially for fix verification. Lacks explicit when-not or alternatives, but context is clear enough.

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

findCyclesFind ROOT CYCLE blocks in a .memgraphA

[mg.memory] Extract just the ROOT CYCLE blocks from a .memgraph as flattened chains (depth + edge + retainKind + className + address). Optionally filter to cycles touching a specific class name (substring match). Use this when you want to inspect chains without the noise of standalone leaks.

ParametersJSON Schema
NameRequiredDescriptionDefault
pathYesAbsolute path to a `.memgraph` file.
classNameNoOptional substring filter — only return cycles where this class name appears in the chain (e.g. "DetailViewModel").
maxDepthNoTruncate chains beyond this depth (default 10).
verbosityNoClass-name verbosity. `compact` shortens SwiftUI generic names aggressively; `full` returns demangled names verbatim.compact

TDQS

A4.2/5.0
Behavior4/5

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

The description explains the output format and filtering capability. It implies a non-destructive analysis. Without annotations, the description carries the full burden, and it adequately covers the tool's behavior, though it could mention that it only reads files and does not modify them.

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 two sentences, front-loaded with the core function, and efficient. 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?

Despite no output schema, the description specifies the output format (flattened chains with fields) and mentions optional filtering and depth truncation. It could be more explicit about the return type (e.g., array), but it is fairly complete for a file-reading analysis tool.

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 for the className parameter (substring match) and the verbosity parameter implicitly, but does not significantly extend understanding beyond the schema.

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 it extracts ROOT CYCLE blocks from a .memgraph as flattened chains with specific fields (depth, edge, retainKind, className, address). It also mentions optional filtering by class name, distinguishing it from analyzing all leaks.

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 'Use this when you want to inspect chains without the noise of standalone leaks,' providing a clear use case. However, it does not name specific alternative tools or state when not to use it.

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

findRetainersFind what retains a classA

[mg.memory] Walk the cycle forest from a .memgraph and return every retain chain that ends in a node whose className contains the given substring. Useful for answering "who is keeping alive?". Returns paths from a top-level node down to the matching node.

ParametersJSON Schema
NameRequiredDescriptionDefault
pathYesAbsolute path to a `.memgraph` file.
classNameYesClass name (or substring) to find retainers for, e.g. "DetailViewModel".
maxResultsNoCap on how many retain chains to return (default 10).
includeReferenceTreeNov1.12+. When true, also run `leaks --debug=stacks --debug='<className>$'` to surface per-instance allocation stacks aggregated by call-stack fingerprint. Required on memgraphs where `leakCount: 0` and the class is reachable from KVO/NotificationCenter/caches (abandoned-memory shape). Each chain returns the allocation call stack + the unique retainer classes + a representative instance address. **Note:** `leaks --debug=stacks` only emits blocks for instances whose allocation stack was recorded, which requires the target was launched with `MallocStackLogging=1`. Xcode's Memory Graph Debugger export does NOT enable MSL by default, so memgraphs captured that way may surface fewer chains than the total instance count from `analyzeMemgraph.abandonedMemorySuspects[]`. Default false preserves v1.11 behavior.

TDQS

A3.9/5.0
Behavior4/5

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

No annotations are provided, so the description carries full burden. It details the includeReferenceTree parameter, including prerequisites (MallocStackLogging) and behavior changes. It does not mention side effects or resource usage, but overall discloses key behavioral aspects.

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 description is concise with two main sentences and a detailed note for includeReferenceTree. The note is necessary but somewhat lengthy. Overall efficient with 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 states what is returned ('paths from a top-level node down to the matching node'). It covers the main behavior and the advanced parameter, though it could benefit from more examples or edge cases.

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 description coverage is 100%, so baseline is 3. The description adds significant context for includeReferenceTree, but for other parameters (path, className, maxResults) it adds minimal value beyond the 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 uses specific verb 'walk' and resource 'retain chains', clearly stating it finds retain chains for a class name substring. It distinguishes itself from siblings like findCycles and analyzeMemgraph by focusing on retainers of a specific class.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description mentions it is 'useful for answering who is keeping <class> alive?', implying when to use, but does not explicitly state when not to use or provide alternatives. Sibling tools are not contrasted.

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

getInvestigationPlaybookGet the canonical tool sequence for a known investigation kindA

[meta] Returns a versioned, declarative pipeline for a known investigation flow (memgraph-leak, perf-hangs, ui-jank, app-launch-slow, verify-fix). Each step has a tool name, purpose, and argsTemplate. Use this once at the start of an investigation so any LLM agent can follow the right sequence without rediscovering it from individual tool descriptions.

ParametersJSON Schema
NameRequiredDescriptionDefault
kindYesWhich investigation flow to return. `memgraph-leak` is the most common — diagnose a SwiftUI/Combine retain cycle from a `.memgraph` and locate it in source.

TDQS

A4.5/5.0
Behavior3/5

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

No annotations provided, so description must carry full burden. It describes the return and usage but does not explicitly state it is read-only or non-destructive, nor mention any side effects.

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?

Two sentences, each earning its place: first defines the tool, second gives usage guidance. Information is front-loaded and efficient.

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 absence of an output schema, the description mentions the structure of each step (tool name, purpose, argsTemplate). This provides adequate completeness for a meta-tool, though a bit more detail on format could be added.

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

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description of the 'kind' parameter adds valuable context beyond the schema, such as the most common flow and its purpose. Schema coverage is 100% and the description enhances understanding.

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?

Clearly states it returns a versioned, declarative pipeline for known investigation flows, with specific examples. Distinguishes itself from sibling analysis tools by being a meta-tool.

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?

Explicitly advises to use it once at the start of an investigation to avoid rediscovery of the tool sequence. Provides a clear context for when to invoke.

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

inspectTraceInspect a .trace bundle's TOC + suggest analyzersA

[mg.discover] Single-call orientation tool for .trace bundles. Runs xcrun xctrace export --xpath '/trace-toc/run' and returns the schemas present (potential-hangs, animation-hitches, time-profile, allocations, app-launch, ...), their row counts, the device model, the OS version, the template name, the recording timestamp, and a suggestedNextCalls[] array mapping each populated schema to its matching analyze* tool with pre-populated args. Use this as the FIRST call when handed a .trace so you do not have to chain 5 analyzers blindly. Empty traces return schemas: [] with a diagnosis pointing at Instruments.app for manual triage. Fallback path: when /trace-toc/run returns non-zero, retries with /trace-toc (older xctrace versions).

ParametersJSON Schema
NameRequiredDescriptionDefault
tracePathYesAbsolute path to a `.trace` bundle (output of `xcrun xctrace record` or Instruments).

TDQS

A4.2/5.0
Behavior4/5

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

Discloses that it runs 'xcrun xctrace export' and returns specific fields like schemas, device info, and suggestedNextCalls. Also describes fallback and empty trace behavior. Since no annotations are provided, the description carries the full burden and does so well.

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 description is front-loaded with the main purpose and usage guidance, and covers fallback and return details efficiently. It is slightly verbose but every sentence adds value.

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?

Given no output schema and many sibling analyzers, the description is exceptionally complete. It explains the return format (schemas, row counts, device, OS, etc.), includes a suggestedNextCalls array to guide tool selection, and addresses empty traces and fallback behavior.

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?

The single parameter 'tracePath' has a description in the schema that is already clear. The description adds minor context (e.g., 'output of xcrun xctrace record or Instruments'), but with 100% schema coverage, the value added is limited, warranting a baseline of 3.

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 an orientation tool for .trace bundles, listing specific outputs like schemas, row counts, and suggested analyzers. It distinguishes itself from sibling analyzers by positioning itself as the first call to avoid blindly chaining analyzers.

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?

Explicitly recommends using this as the first call when handed a .trace, and describes a fallback path for older xctrace versions. However, it does not explicitly state when not to use it or provide alternatives for other scenarios.

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

listTraceDevicesList physical devices and simulatorsA

[mg.discover] Run xcrun xctrace list devices and return parsed devices/simulators with their UDIDs. The LLM should call this before recordTimeProfile to discover the right UDID without asking the user. Set includeOffline: true to include disconnected devices.

ParametersJSON Schema
NameRequiredDescriptionDefault
includeOfflineNoInclude devices listed under "Devices Offline" (default false).

TDQS

A4/5.0
Behavior3/5

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

With no annotations, the description carries the full burden. It explains it runs a shell command and parses output, and describes the parameter behavior. However, it does not disclose potential side effects, required permissions, or return format details, which are typical for a list 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 two sentences with an additional sentence for the parameter, all front-loaded with the main action. No unnecessary words or 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 simplicity (1 param, no output schema, no nested objects), the description covers the essential aspects: what it does, when to use it, and a parameter detail. It could mention the output format but is adequate overall.

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% with one parameter described. The description adds the term 'disconnected devices' as a synonym for 'Devices Offline', but this is marginal improvement over the schema's existing description. Baseline 3 applies.

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 runs 'xcrun xctrace list devices' and returns parsed devices/simulators with UDIDs, which is a specific verb+resource. It distinguishes itself from siblings by being the pre-requisite for recordTimeProfile and for device discovery.

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 tells the LLM to call this before recordTimeProfile to discover the right UDID without asking the user, providing clear when-to-use context. It also explains the includeOffline parameter but does not explicitly mention when not to use the tool.

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

listTraceTemplatesList xctrace recording templatesA

[mg.discover] Run xcrun xctrace list templates and return parsed standard + custom templates. Useful when picking a template name for recordTimeProfile (e.g. "Time Profiler", "Animation Hitches", "Allocations").

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A4.5/5.0
Behavior4/5

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

No annotations provided; description reveals it executes an external command and returns parsed templates. Provides transparency about the operation and output type.

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?

Two concise sentences: first states action and output, second gives usage context with examples. No unnecessary words.

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?

Given no parameters and no output schema, description fully covers purpose and usage context. No gaps for an agent to understand.

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?

No parameters, schema coverage 100%. Baseline for 0 params is 4; description adds no param info needed.

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?

Clearly states it runs 'xcrun xctrace list templates' and returns parsed standard + custom templates. Distinguishes itself as the tool to list templates, unlike sibling analysis tools.

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?

Explicitly says 'Useful when picking a template name for recordTimeProfile' with examples. Does not mention when not to use or alternatives, but context is clear.

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

logShowQuery macOS unified logging (one-shot)A

[mg.log] Wrap log show --style compact --last <window> with optional NSPredicate filter, process and subsystem sugar. Returns parsed entries (timestamp, type, process, pid, subsystem, category, message) bounded by maxEntries. Use this to look back at app logs without leaving chat.

ParametersJSON Schema
NameRequiredDescriptionDefault
lastNoTime window to look back from now (e.g. "30s", "5m", "1h", "2d"). Default 5m.5m
predicateNoNSPredicate-style filter passed to `log show --predicate`. Examples: `process == "DemoApp"`, `subsystem == "com.example.app"`, `messageType == error`.
processNoFilter to a single process name. Sugar over `--predicate process == "<name>"`.
subsystemNoFilter to a single subsystem identifier.
levelNoMinimum log level. `default` = default+error+fault. `info` adds info-level. `debug` adds info+debug.default
maxEntriesNoCap on parsed entries returned (default 500). Output is truncated to the first N matching.

TDQS

A4.6/5.0
Behavior4/5

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

With no annotations, the description discloses that it wraps log show (a read operation), returns parsed entries with specific fields, and bounds output by maxEntries. It explains the sugar for process and subsystem filters.

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 two sentences and a tag, front-loading the core purpose. Every sentence adds value with no waste.

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?

Given six parameters (all documented in schema), no output schema, and 100% schema coverage, the description explains the output format (parsed entries with fields) and bounding. It is complete for a one-shot query tool.

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

Parameters5/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 significant meaning: explains the sugar for process and subsystem over predicate, describes the level enum as minimum log level, and clarifies maxEntries as a cap on parsed entries.

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 it queries macOS unified logging one-shot, wrapping log show with filters and sugar. It distinguishes from sibling tools like logStream (streaming) by using 'one-shot' in the title and describes the parsed output.

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 says 'Use this to look back at app logs without leaving chat,' implying a one-shot query scenario. It does not explicitly mention when not to use or contrast with alternatives like logStream, but the context implies it.

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

logStreamStream macOS unified logging for a bounded windowB

[mg.log] Wrap log stream --style compact for a bounded duration (≤60 s — MCP requests should not block longer). Returns parsed entries collected during the window. Useful for capturing a specific user flow without setting up a full Console.app session.

ParametersJSON Schema
NameRequiredDescriptionDefault
durationSecNoHow long to listen for log entries (max 60 seconds — MCP requests should not block longer). Default 10.
predicateNo
processNo
subsystemNo
levelNodefault
maxEntriesNo

TDQS

B3.4/5.0
Behavior3/5

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

No annotations are provided, so the description carries the burden. It discloses the underlying command, bounded duration (≤60s), and that it returns parsed entries. However, it does not describe error handling, destructive potential, or other behavioral traits beyond the basic operation.

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 description is concise at three sentences, front-loaded with the core purpose. It could benefit from a more structured breakdown of parameters and usage.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the 6 parameters and no output schema, the description is incomplete. It lacks details on return format, parameter semantics beyond duration, and how to interpret parsed entries. The absence of annotations exacerbates the gaps.

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

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 6 parameters with only 17% description coverage (only durationSec has a description). The description adds minimal meaning beyond the schema, mainly repeating the duration constraint and default. It does not explain predicate, process, subsystem, level, or maxEntries.

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 it wraps `log stream --style compact` for a bounded duration, returns parsed entries, and is useful for capturing a specific user flow. It effectively distinguishes itself from sibling tools like logShow and other analysis tools.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for capturing user flows without setting up Console.app, but lacks explicit guidance on when not to use or alternatives. It does not mention contexts where it might be inappropriate or provide exclusions.

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

reachableFromCycleCount instances reachable from a specific cycle rootA

[mg.memory] Cycle-scoped reachability + class counting. Answers questions like "how many NSURLSessionConfiguration instances are reachable from the cycle rooted at DetailViewModel?" — distinguishing the actual culprit (the cycle root) from its retained dependencies. Pick a cycle by zero-based cycleIndex or by rootClassName substring. Returns per-class counts ranked by occurrence, plus the total reachable node count.

ParametersJSON Schema
NameRequiredDescriptionDefault
pathYesAbsolute path to a `.memgraph` file.
cycleIndexNoZero-based index of the ROOT CYCLE to scope to. Mutually exclusive with `rootClassName`. When neither is given, defaults to cycle index 0.
rootClassNameNoSubstring of the root cycle's class name (e.g. "DetailViewModel"). Picks the first ROOT CYCLE whose root matches. Mutually exclusive with `cycleIndex`.
classNameNoOptional filter — only count nodes whose className contains this substring. When omitted, returns the full per-class breakdown.
topNNoCap on per-class entries returned (default 20).
verbosityNoClass-name verbosity for the response. See analyzeMemgraph for the same flag.compact

TDQS

A4.1/5.0
Behavior4/5

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

No annotations provided, so description carries full burden. It details the return format (per-class counts, total reachable node count) and explains default behavior for cycleIndex. Does not mention potential errors or side effects, but for a read-only analysis tool this is acceptable.

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?

Description is front-loaded with purpose and includes a concrete example. It is slightly verbose but each sentence adds value. Could be streamlined, but overall well-structured.

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 no output schema and six parameters, description adequately explains output and parameter usage. It covers the primary use case and parameter interplay. Lacks error handling details, but that is secondary for this tool.

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 description coverage is 100%, so baseline is 3. Description adds some value beyond schema (e.g., output format, cycleIndex default), but does not significantly enhance understanding of individual parameters beyond what the schema already provides.

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?

Description begins with '[mg.memory] Cycle-scoped reachability + class counting' and provides a concrete example ('how many NSURLSessionConfiguration instances are reachable from the cycle rooted at DetailViewModel?'). It clearly identifies the tool's function and distinguishes it from sibling tools by focusing on cycle-root scoped reachability rather than general leak analysis.

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?

Description explains how to select a cycle via cycleIndex or rootClassName, and gives a concrete question the tool answers. It lacks explicit when-not-to-use or alternative tool mentions, but the guidance is sufficient for the intended use case.

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

recordTimeProfileRecord a Time Profiler traceA

[mg.trace] Wrapper around xcrun xctrace record. Capture a .trace bundle from a running app on a device or simulator. Required: exactly 1 of deviceId/simulatorId, exactly 1 of attachAppName/attachPid/launchBundleId, an output path ending in .trace. Defaults: template = "Time Profiler", durationSec = 90.

ParametersJSON Schema
NameRequiredDescriptionDefault
templateNoxctrace template name (e.g. "Time Profiler", "Animation Hitches", "Allocations"). Default "Time Profiler".Time Profiler
deviceIdNoUDID of a physical device. Mutually exclusive with `simulatorId`.
simulatorIdNoUDID of a simulator. Mutually exclusive with `deviceId`. Use `listTraceDevices` to find UDIDs.
attachAppNameNoAttach to a running app by name (e.g. "DemoApp"). Mutually exclusive with `attachPid` and `launchBundleId`.
attachPidNoAttach by PID. Mutually exclusive with `attachAppName` and `launchBundleId`.
launchBundleIdNoLaunch app by bundle id and start recording at launch. Mutually exclusive with `attachAppName` and `attachPid`.
durationSecNoRecording duration in seconds (default 90, max 600).
outputYesAbsolute path where the resulting `.trace` bundle should be written. Must end in `.trace`.

TDQS

A4.5/5.0
Behavior4/5

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

No annotations provided, so description carries full burden. Describes that it records a trace, specifies default template and duration, and output path constraint. Lacks mention of side effects like file creation or potential wait time, but adequate for a capture 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?

Two sentences with clear structure and front-loaded key information. Every sentence adds value.

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?

Covers all essential aspects: recording purpose, required parameter groups, defaults, and output constraint. No explanation of return value, but file-based output is implied. Good for an agent to invoke correctly.

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

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, and description adds mutual exclusivity rules and output path format, which go beyond individual parameter 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?

Clearly states it captures a .trace bundle using xcrun xctrace record, specifying it wraps the underlying command. Distinguishes from sibling tools like recordViaInstrumentsApp.

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?

Explicitly lists required parameter combinations (exactly one of deviceId/simulatorId, etc.) and defaults. Not explicit about when not to use, but context with sibling tools makes usage clear.

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

recordViaInstrumentsAppRecord a .trace via Instruments.app GUI (macOS 26.x workaround)A

[mg.build] Open Instruments.app, prompt the user to record + save a .trace, then poll a watchDir for the new bundle and chain into inspectTrace. The macOS 26.x escape hatch: xcrun xctrace record wedges on this OS but Instruments.app GUI still produces valid traces. Returns instructions[] for the user-in-loop step, tracePath when found, plus a chained inspectTrace summary. Times out after timeoutSec (default 600s). v1.16+.

ParametersJSON Schema
NameRequiredDescriptionDefault
templateNoThe Instruments template the user should pick after the app launches. Surfaced in the response's instructions array. Default 'Time Profiler'. Common alternatives: 'Allocations', 'Animation Hitches', 'Leaks', 'Energy Log', 'Network Profile'.Time Profiler
watchDirNoDirectory to watch for the saved `.trace` bundle. When omitted, defaults to $MEMORYDETECTIVE_TRACE_ROOT (typically `~/Library/Application Support/memorydetective/traces`). The directory is created if it does not exist.
timeoutSecNoMaximum seconds to wait for the user to save a `.trace` before returning a timeout. Default 600 (10 minutes). Capped at 3600 (1 hour).
preexistingTracesNoAbsolute paths to `.trace` bundles already in `watchDir`. The watcher excludes these so it only matches NEW files. When omitted, the watcher snapshots the directory at start. Optional override for callers who want explicit control.

TDQS

A3.9/5.0
Behavior3/5

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

The description mentions user-in-loop step, polling, timeout, and chained inspectTrace summary, but lacks details on error handling, side effects (e.g., leftover files), or blocking nature. With no annotations, the description carries full burden and provides adequate but not comprehensive transparency.

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?

Four sentences efficiently cover action, rationale, return values, and timeout. The title provides additional context. Could be slightly more concise (e.g., remove version number), but overall well-structured and front-loaded.

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 complexity of a tool requiring user interaction, polling, and chaining, the description sufficiently explains the return structure (instructions, tracePath, inspectTrace summary) and timeout. Missing output schema is compensated. No mention of error states or termination beyond timeout.

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% with detailed descriptions for each parameter. The description adds minimal value beyond schema, only repeating the timeout default and mentioning the chaining behavior. Baseline 3 is appropriate as schema does the heavy lifting.

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's purpose: open Instruments.app, prompt user to record/save a .trace, poll watchDir for new bundle, and chain into inspectTrace. It explicitly distinguishes from sibling recordTimeProfile by framing it as a macOS 26.x workaround for the failing xcrun xctrace record.

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 provides context for when to use (macOS 26.x escape hatch) and chaining into inspectTrace, but does not explicitly state when not to use or name alternatives beyond xcrun xctrace record. Sibling list includes recordTimeProfile, but no comparative guidance.

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

renderCycleGraphRender a retain cycle as Mermaid or DOT graphA

[mg.render] Read a .memgraph, pick a ROOT CYCLE by index, and emit the chain as a Mermaid graph definition (default — embeddable in markdown / GitHub) or a Graphviz DOT file. App-level classes are highlighted; CYCLE BACK terminators are styled distinctly. Use cycleIndex to render cycles other than the first.

ParametersJSON Schema
NameRequiredDescriptionDefault
pathYesAbsolute path to a `.memgraph` file.
cycleIndexNoZero-based index of the ROOT CYCLE to render (default 0 = the first cycle, usually the largest).
formatNoOutput format: `mermaid` (GitHub-renderable, embeddable in markdown) or `dot` (Graphviz format).mermaid
maxDepthNoTruncate the rendered graph beyond this chain depth (default 8).
truncateClassNameNoTruncate long generic SwiftUI class names to this many characters (default 60). The full name still appears in node IDs.

TDQS

A4.2/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It discloses that app-level classes are highlighted and cycle-back terminators are styled distinctly, but does not cover error behavior or side effects such as file reading failures.

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 concise with three sentences. The first sentence captures the main action, the second adds styling details, and the third provides a usage tip. No unnecessary words, and it is front-loaded.

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?

The description explains output format options and styling, and combined with the schema, covers the tool's functionality. However, it lacks details on return values or error handling, but for a rendering tool, it is adequate.

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 description coverage is 100%, so the schema documents all parameters. The description adds context beyond the schema by mentioning styling details and usage hint for cycleIndex, providing moderate additional value.

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 renders a retain cycle as a Mermaid or DOT graph from a .memgraph file, specifying the verb 'render' and resource 'retain cycle'. It differentiates from sibling tools like findCycles by focusing on graphical output.

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 provides explicit usage guidance by mentioning the use of cycleIndex to render cycles other than the first. It does not explicitly state when not to use or compare to alternatives, but the context is clear for rendering tasks.

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

replayScenarioReplay a UI scenario to amplify a suspected leakA

[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.

ParametersJSON 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.

TDQS

A4.4/5.0
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.

summarizeTraceSingle-call cross-schema summary card for a .trace bundleA

[mg.synthesize] The trace-to-summary-card-in-one-call play. Chains inspectTrace + the matching analyze* tools (potential-hangs, animation-hitches, time-profile, allocations, app-launch) and returns BOTH a structured per-area result AND a pre-rendered compact markdown card (< 10 KB at default settings). Use this as the FIRST call when handed a .trace if you want one synthesis pass instead of chaining 5-6 analyzers manually. The markdown card carries a 1-sentence headline naming the biggest user-impact finding, then per-area sub-sections, then suggestedNextCalls[] for drilling in. Empty schemas are suppressed from the card to reduce noise. Failed analyzers (e.g. xctrace SIGSEGV on time-profile) surface inline with their workaround notice. Pass verbose: true to expand each section's top-N from 5 to 15+. Pass focus: "hangs" | "hitches" | "allocations" | "launch" to bias the summary toward a specific area.

ParametersJSON Schema
NameRequiredDescriptionDefault
tracePathYesAbsolute path to a `.trace` bundle (output of `xcrun xctrace record` or Instruments).
focusNoWhen set to a specific area, the summary card emphasizes that area and downplays others. Useful for piping into more focused agent loops. Default `all`.all
verboseNoWhen true, the markdown card includes the full top-N per area (15+ rows per section) instead of the default 5. Trade-off: card grows from <10 KB to potentially 30+ KB.

TDQS

A4.4/5.0
Behavior4/5

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

No annotations are provided, so the description must disclose behavior fully. It explains chaining of tools, output composition (structured result + markdown card), handling of empty schemas and analyzer failures, and the impact of verbose/focus parameters. It does not discuss performance or authorization, but covers key behavioral traits.

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 description is compact yet comprehensive, starting with a concise summary and then detailing usage, output, and parameter effects. Every sentence adds value, though it could be slightly more concise without losing information.

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?

Given the tool's complexity (chaining multiple analyzers), the absence of annotations and output schema, the description is remarkably complete. It explains the output format (headline, per-area sections, suggestedNextCalls), parameter effects, and edge cases (analyzer failures), fully compensating for missing metadata.

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% (all three parameters have descriptions). The description adds value by clarifying tracePath ('absolute path'), focus ('emphasizes that area'), and verbose ('card size trade-off'), going beyond the schema's basic 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 states a specific verb 'summarize' and resource '.trace bundle', and clearly distinguishes from siblings by describing it as a single-call synthesis that chains multiple analyzers, contrasting with individual analyzer tools.

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?

Explicitly advises using as the first call for a synthesis pass instead of manually chaining analyzers, and describes parameter effects. However, it could more explicitly state when not to use it (e.g., for raw data from a specific analyzer).

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

swiftFindSymbolReferencesFind every reference to a Swift symbolA

[mg.code] Locates the symbol's declaration in filePath, then asks SourceKit-LSP for textDocument/references. Returns every callsite + capture across the project, with a snippet of each line. Requires an IndexStoreDB at <projectRoot>/.build/index/store for cross-file references — build it with swift build -Xswiftc -index-store-path -Xswiftc <projectRoot>/.build/index/store. The result includes a needsIndex: true hint when the index is missing.

ParametersJSON Schema
NameRequiredDescriptionDefault
symbolNameYesName of the Swift symbol to find references for.
filePathYesPath to a Swift file where the symbol is declared. The LSP query needs a position; we locate it in this file via a regex pre-scan.
projectRootNoOverride the project root. Default discovers the nearest Package.swift / .xcodeproj / .xcworkspace.
includeDeclarationNoInclude the declaration site itself in the result set.

TDQS

A4.5/5.0
Behavior5/5

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

With no annotations, the description fully discloses the mechanism (SourceKit-LSP, regex pre-scan), the requirement for an index store, and the output behavior including the 'needsIndex' hint. It is complete and transparent.

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 description is front-loaded with the purpose and uses a clear structure, but it is slightly verbose with code blocks and extra detail. Still efficient for the information conveyed.

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 complexity (4 params, no output schema), the description covers the output format (snippet per line, hint) and requirements. Could be more explicit about the exact output structure, but sufficient for an agent.

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 explaining how filePath is used for locating the declaration and the default discovery for projectRoot, going beyond the 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 it finds every reference to a Swift symbol, using the verb 'find' and resource 'Swift symbol references'. It distinguishes from sibling tools like swiftGetSymbolDefinition by focusing on all references across the project.

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?

It explains the prerequisite of an IndexStoreDB and how to build it, but does not explicitly exclude alternatives or specify when not to use it compared to sibling tools. The context is clear for typical usage.

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

swiftGetHoverInfoGet type info / docs at a Swift source positionA

[mg.code] SourceKit-LSP textDocument/hover at a (line, character) position. Returns the markdown / plaintext hover content plus a best-effort extracted declaration fragment. Use to disambiguate self captures: a class self in a closure can leak; a struct self can't.

ParametersJSON Schema
NameRequiredDescriptionDefault
filePathYesAbsolute path to a Swift source file.
lineYesZero-based line number (LSP convention).
characterYesZero-based UTF-16 character offset within the line.
projectRootNo

TDQS

A3.9/5.0
Behavior3/5

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

With no annotations, the description carries the full burden. It describes the output (markdown/plaintext hover content and declaration fragment) but does not disclose behavioral traits such as read-only nature, error handling, or performance characteristics. The 'best-effort' qualifier adds some transparency but is insufficient.

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 extremely concise: two sentences that immediately convey the technical identity and a practical use case. Every sentence earns its place without fluff.

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?

Despite lacking an output schema, the description explains what is returned (markdown/plaintext hover content and declaration fragment). It also gives a concrete usage context. However, it could be more detailed about the return structure or potential failure cases, which prevents a perfect score.

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

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description does not add any meaning beyond the input schema. Schema coverage is 75% (projectRoot lacks description), and the description does not clarify that parameter or provide additional context for other parameters. The description adds zero value for parameter understanding.

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 it performs a SourceKit-LSP textDocument/hover request at a specific position, which is a specific verb+resource. It distinguishes from sibling tools like swiftGetSymbolDefinition by focusing on hover content and type info, not definitions.

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 provides a explicit use case: disambiguating self captures in closures. However, it does not mention when not to use it or suggest alternatives, which prevents a higher score.

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

swiftGetSymbolDefinitionLocate a Swift symbol's source declarationA

[mg.code] Find the file:line where a Swift symbol (class, struct, enum, protocol, func, var, etc.) is declared. Pre-scans candidatePaths (or hint.filePath) with a fast regex first, then asks SourceKit-LSP for jump-to-definition. Returns the position even when LSP can't follow through. Use after findRetainers / classifyCycle surface a class name from a memgraph cycle to land in the actual source file.

ParametersJSON Schema
NameRequiredDescriptionDefault
symbolNameYesName of the Swift symbol to locate (class, struct, enum, protocol, func, var, etc.).
hintNoOptional hint to speed up the search. `filePath` skips the project scan; `module` is reserved for future multi-module work.
projectRootNoOverride the project root. Default discovers the nearest Package.swift / .xcodeproj / .xcworkspace from the cwd.
candidatePathsNoIf provided, search these files for the symbol declaration before asking SourceKit-LSP. Speeds up location when the agent already has a guess (e.g. from `findSymbolReferences` or `swift_search_pattern`).

TDQS

A4.6/5.0
Behavior5/5

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

Without annotations, the description fully discloses behavior: pre-scans with regex, uses SourceKit-LSP, returns position even if LSP fails. This gives the agent a clear model of how the tool operates.

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?

Two concise sentences plus a usage note. Every sentence earns its place: first states purpose and algorithm, second provides workflow context. No redundant information.

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 4 params, nested object, and no output schema, the description covers the algorithm, fallback, and typical use case. Lacks explicit return format (e.g., file path and line number), but 'Returns the position' is adequate. Complete enough for the complexity.

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%, baseline 3. Description adds meaning for all parameters: explains symbolName types, hint usage, projectRoot override, and candidatePaths as a speedup. Exceeds baseline by explaining the two-step search process.

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?

Clearly states it finds the file:line where a Swift symbol is declared, using specific verb-resource pairs. Distinguishes from siblings like swiftFindSymbolReferences by mentioning typical use after findRetainers/classifyCycle.

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?

Explicitly says to use after findRetainers/classifyCycle to land in source file. Provides guidance on candidatePaths and hint to speed up search. Does not list alternative tools for different purposes, but implies context.

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

swiftGetSymbolsOverviewList top-level symbols in a Swift fileA

[mg.code] Cheap orientation: returns the top-level symbols (classes, structs, enums, protocols, free functions) declared in a Swift file via SourceKit-LSP's documentSymbol. Set topLevelOnly: false for nested children too. Useful right after swiftGetSymbolDefinition lands you in a new file.

ParametersJSON Schema
NameRequiredDescriptionDefault
filePathYesAbsolute path to a Swift source file.
projectRootNo
topLevelOnlyNoReturn only top-level symbols (classes, structs, enums, protocols, free functions). When false, returns nested children too. Default true keeps responses small.

TDQS

A4.1/5.0
Behavior4/5

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

Describes as 'cheap orientation' via SourceKit-LSP's documentSymbol, implying a read-only, lightweight operation. No annotations to contradict; clear enough for agent to infer safety.

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?

Two concise sentences, front-loaded with purpose and key parameter guidance. No redundant or irrelevant information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Covers purpose and usage context well, but lacks description of return format (symbol structure) despite no output schema. Relies on prior knowledge of documentSymbol output.

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?

Adds value for topLevelOnly by explaining its effect and default behavior. But projectRoot lacks description in both schema and tool description, and filePath is covered identically in schema.

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?

Description clearly states verb (returns), resource (top-level symbols in Swift file), and distinguishes from sibling swiftGetSymbolDefinition by noting it gives orientation after landing in a new file.

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?

Explicitly suggests using after swiftGetSymbolDefinition for quick orientation, and hints at topLevelOnly parameter adjustment. Does not exclude other cases or compare with other swift tools.

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

swiftSearchPatternRegex-search a Swift file (no LSP)A

[mg.code] Pure regex search over a file's contents — no SourceKit-LSP, no IndexStoreDB. Catches what LSP misses: closure capture lists ([weak self], [unowned self]), Task { ... self ... } blocks, and any other pattern the agent constructs from a leak chain. Returns matches with line/character positions and a trimmed snippet.

ParametersJSON Schema
NameRequiredDescriptionDefault
filePathYesAbsolute path to a Swift source file.
patternYesRegex pattern (JavaScript flavour). The `g` flag is implied — every match is returned.
flagsNoAdditional RegExp flags ("i", "m", "s", "im", etc.).
maxMatchesNoCap on matches returned (default 50).

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations, the description carries full burden. It discloses that the tool does not use SourceKit-LSP or IndexStoreDB, is a pure regex search, and returns positional data with snippets. It could mention that it is read-only with no side effects, but the current detail is sufficient for safe invocation.

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. The first sentence immediately states the core functionality and constraints. Every subsequent sentence adds meaningful context (what it catches, return format) without unnecessary 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?

Given the tool's moderate complexity and absence of an output schema, the description adequately covers purpose, usage, and return format. It could address edge cases like invalid regex or missing file, but overall it is complete enough for effective use.

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%, but the description adds value beyond schema descriptions. It explicitly notes the regex is JavaScript flavor with an implied 'g' flag, and suggests patterns for leak hunting. These details help the agent craft effective queries.

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 it performs pure regex search over a Swift file's contents, distinguishing it from LSP-based tools. Specific examples (closure capture lists, Task blocks) make the purpose unmistakable and differentiate it from sibling tools like swiftFindSymbolReferences.

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 implies when to use the tool—'Catches what LSP misses'—and provides concrete patterns from leak investigations. While it does not explicitly list when not to use or name alternatives, the context is strong enough for an AI agent to infer appropriate scenarios.

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

verifyFixVerify a fix actually closed the targeted retain cycleA

[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.

ParametersJSON 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

TDQS

A4.4/5.0
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.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 25 tool updatesv1.18.1
    • AddedanalyzeAbandonedMemory
    • ChangedanalyzeAllocations1 field changed
      • addedInput schema / properties / outputFormat
        Added value: +{
        +  "description": "Response format. Omitted or `json` (default, preserves v1.8 behavior) returns JSON.stringify of the result. `markdown` renders a human-readable view of the same data. `both` returns both content items in one response, so a client can display markdown to the user and parse JSON for the agent loop without a second call. `verify-fix-table` (v1.10, applies to `analyzeAbandonedMemory` and `diffMemgraphs`) emits a focused 4-column markdown comparison table (Class | Before | After | Delta) of the actionable rows; other tools fall back to `markdown` for this value.",
        +  "enum": [
        +    "markdown",
        +    "json",
        +    "both",
        +    "verify-fix-table"
        +  ],
        +  "type": "string"
        +}
    • ChangedanalyzeAnimationHitches3 fields changed
      • changedInput schema / properties / minDurationMs / description
        Previous value: -"Filter out hitches shorter than this duration in milliseconds. Apple categorizes hitches >100ms as user-perceptible — pass 100 to focus on those."New value: +"Filter out hitches shorter than this duration in milliseconds. Apple categorizes hitches >100ms as user-perceptible, pass 100 to focus on those."
      • addedInput schema / properties / outputFormat
        Added value: +{
        +  "description": "Response format. Omitted or `json` (default, preserves v1.8 behavior) returns JSON.stringify of the result. `markdown` renders a human-readable view of the same data. `both` returns both content items in one response, so a client can display markdown to the user and parse JSON for the agent loop without a second call. `verify-fix-table` (v1.10, applies to `analyzeAbandonedMemory` and `diffMemgraphs`) emits a focused 4-column markdown comparison table (Class | Before | After | Delta) of the actionable rows; other tools fall back to `markdown` for this value.",
        +  "enum": [
        +    "markdown",
        +    "json",
        +    "both",
        +    "verify-fix-table"
        +  ],
        +  "type": "string"
        +}
      • addedInput schema / properties / timeRangeMs
        Added value: +{
        +  "additionalProperties": false,
        +  "description": "Optional time-window filter. Only hitches whose `startNs` falls within `[startMs, endMs]` (milliseconds since recording start) are included. Use this to answer 'what hitches happened during this 5-second user-visible jank window?' without re-recording.",
        +  "properties": {
        +    "endMs": {
        +      "minimum": 0,
        +      "type": "number"
        +    },
        +    "startMs": {
        +      "minimum": 0,
        +      "type": "number"
        +    }
        +  },
        +  "required": [
        +    "startMs",
        +    "endMs"
        +  ],
        +  "type": "object"
        +}
    • ChangedanalyzeAppLaunch1 field changed
      • addedInput schema / properties / outputFormat
        Added value: +{
        +  "description": "Response format. Omitted or `json` (default, preserves v1.8 behavior) returns JSON.stringify of the result. `markdown` renders a human-readable view of the same data. `both` returns both content items in one response, so a client can display markdown to the user and parse JSON for the agent loop without a second call. `verify-fix-table` (v1.10, applies to `analyzeAbandonedMemory` and `diffMemgraphs`) emits a focused 4-column markdown comparison table (Class | Before | After | Delta) of the actionable rows; other tools fall back to `markdown` for this value.",
        +  "enum": [
        +    "markdown",
        +    "json",
        +    "both",
        +    "verify-fix-table"
        +  ],
        +  "type": "string"
        +}
    • AddedanalyzeEnergyImpact
    • ChangedanalyzeHangs5 fields changed
      • addedInput schema / properties / includeStackClassification
        Added value: +{
        +  "default": false,
        +  "description": "v1.12+. When true, analyzeHangs internally exports the `time-profile` schema in parallel with `potential-hangs`, correlates samples to hang windows by timestamp, picks the dominant top frame per hang, and runs `classifyHangFrame` on it. The `mainThreadViolations[]` field on each top hang is populated automatically. Replaces the v1.9 caller-built `topFramesByHangStartNs` map: most callers should set this flag instead of building the map manually. Adds a second xctrace export call, run in parallel with the hangs export so wall-clock is unchanged when the trace export succeeds. Falls back gracefully (empty violations, no error) when the time-profile schema is absent or xctrace SIGSEGVs on it.",
        +  "type": "boolean"
        +}
      • changedInput schema / properties / minDurationMs / description
        Previous value: -"Filter out hangs shorter than this duration in milliseconds (default 0 — include all). Use 250 to focus on \"real\" hangs only."New value: +"Filter out hangs shorter than this duration in milliseconds (default 0, include all). Use 250 to focus on 'real' hangs only."
      • addedInput schema / properties / outputFormat
        Added value: +{
        +  "description": "Response format. Omitted or `json` (default, preserves v1.8 behavior) returns JSON.stringify of the result. `markdown` renders a human-readable view of the same data. `both` returns both content items in one response, so a client can display markdown to the user and parse JSON for the agent loop without a second call. `verify-fix-table` (v1.10, applies to `analyzeAbandonedMemory` and `diffMemgraphs`) emits a focused 4-column markdown comparison table (Class | Before | After | Delta) of the actionable rows; other tools fall back to `markdown` for this value.",
        +  "enum": [
        +    "markdown",
        +    "json",
        +    "both",
        +    "verify-fix-table"
        +  ],
        +  "type": "string"
        +}
      • addedInput schema / properties / timeRangeMs
        Added value: +{
        +  "additionalProperties": false,
        +  "description": "Optional time-window filter. Only hangs whose `startNs` falls within `[startMs, endMs]` (milliseconds since recording start) are included. Use this to answer 'what hangs happened between t=2s and t=7s?' without re-recording.",
        +  "properties": {
        +    "endMs": {
        +      "minimum": 0,
        +      "type": "number"
        +    },
        +    "startMs": {
        +      "minimum": 0,
        +      "type": "number"
        +    }
        +  },
        +  "required": [
        +    "startMs",
        +    "endMs"
        +  ],
        +  "type": "object"
        +}
      • addedInput schema / properties / topFramesByHangStartNs
        Added value: +{
        +  "additionalProperties": {
        +    "type": "string"
        +  },
        +  "description": "Optional supplemental map from a hang's `startNs` (as a string) to the top frame seen during that hang. When provided, each matching hang in `top[]` is enriched with `mainThreadViolations[]` that catalog the kind of work happening on the main thread (sync-io, db-lock, network, lock-contention). Typical pipeline: call `analyzeTimeProfile` separately on the same `.trace`, correlate samples to hang windows by timestamp, then re-call `analyzeHangs` with the resulting map. Omit to skip the enrichment. SUPERSEDED in v1.12 by `includeStackClassification: true`, which builds this map internally.",
        +  "type": "object"
        +}
    • AddedanalyzeLeakTimeline
    • ChangedanalyzeMemgraph3 fields changed
      • changedInput schema / properties / maxClassesInChain / description
        Previous value: -"Cap on how many unique class names to surface per cycle's `classesInChain` array. Default 10 — enough to identify app-level types without flooding the response."New value: +"Cap on how many unique class names to surface per cycle's `classesInChain` array. Default 10, enough to identify app-level types without flooding the response."
      • addedInput schema / properties / outputFormat
        Added value: +{
        +  "description": "Response format. Omitted or `json` (default, preserves v1.8 behavior) returns JSON.stringify of the result. `markdown` renders a human-readable view of the same data. `both` returns both content items in one response, so a client can display markdown to the user and parse JSON for the agent loop without a second call. `verify-fix-table` (v1.10, applies to `analyzeAbandonedMemory` and `diffMemgraphs`) emits a focused 4-column markdown comparison table (Class | Before | After | Delta) of the actionable rows; other tools fall back to `markdown` for this value.",
        +  "enum": [
        +    "markdown",
        +    "json",
        +    "both",
        +    "verify-fix-table"
        +  ],
        +  "type": "string"
        +}
      • addedInput schema / properties / referenceTreeTopN
        Added value: +{
        +  "default": 20,
        +  "description": "When `leakCount` is 0 (the typical abandoned-memory case), also run `leaks --referenceTree --groupByType --noContent` and surface the top N classes by live instance count in `abandonedMemoryTop[]`. Set to 0 to skip the second leaks invocation. Default 20.",
        +  "maximum": 200,
        +  "minimum": 0,
        +  "type": "integer"
        +}
    • AddedanalyzeMemoryFootprint
    • AddedanalyzeMetricKitPayload
    • AddedanalyzeNetworkActivity
    • ChangedanalyzeTimeProfile1 field changed
      • addedInput schema / properties / outputFormat
        Added value: +{
        +  "description": "Response format. Omitted or `json` (default, preserves v1.8 behavior) returns JSON.stringify of the result. `markdown` renders a human-readable view of the same data. `both` returns both content items in one response, so a client can display markdown to the user and parse JSON for the agent loop without a second call. `verify-fix-table` (v1.10, applies to `analyzeAbandonedMemory` and `diffMemgraphs`) emits a focused 4-column markdown comparison table (Class | Before | After | Delta) of the actionable rows; other tools fall back to `markdown` for this value.",
        +  "enum": [
        +    "markdown",
        +    "json",
        +    "both",
        +    "verify-fix-table"
        +  ],
        +  "type": "string"
        +}
    • AddedbootAndLaunchForLeakInvestigation
    • AddedcaptureScenarioState
    • AddedcleanupTraces
    • ChangedcountAlive6 fields changed
      • addedInput schema / properties / additionalNoisePatterns
        Added value: +{
        +  "description": "v1.17 B-10. Extra regex patterns (one per string) added to the noise filter. Useful when your app's noise classes are not in the curated list (e.g. third-party SDK collection storage that scales with app activity). Patterns are matched case-sensitively against the class name.",
        +  "items": {
        +    "minLength": 1,
        +    "type": "string"
        +  },
        +  "type": "array"
        +}
      • addedInput schema / properties / excludeFrameworkNoise
        Added value: +{
        +  "default": true,
        +  "description": "v1.17 B-10. When `includeReferenceTree: true`, populates `actionableCounts[]` with the framework-noise classes filtered out (NSMutableDictionary, CFString, __DATA __bss, dispatch_queue_t, etc.). Set false to disable the filter and surface the raw counts only via `counts[]`. The curated noise list is calibrated for abandoned-memory investigations; combine with `additionalNoisePatterns` / `unsuppressClassPatterns` to tune.",
        +  "type": "boolean"
        +}
      • addedInput schema / properties / includeReferenceTree
        Added value: +{
        +  "default": false,
        +  "description": "v1.12+. When true, also parse `leaks --referenceTree --groupByType --noContent` output and surface heap-wide instance counts alongside the cycle-side counts. Required to find classes on memgraphs where `leakCount: 0` and the abandoned-memory shape is what's interesting (e.g. orphaned KVO observers reachable from the global registry). Adds a second `leaks` invocation, run in parallel. Default false preserves v1.11 behavior.",
        +  "type": "boolean"
        +}
      • addedInput schema / properties / noiseAuditMode
        Added value: +{
        +  "default": false,
        +  "description": "v1.17 B-10. When true, returns an extra `noiseAudit[]` field listing each class that was filtered out, with the matching reason ('default-list', 'additional-pattern', or 'kept-by-unsuppress'). Lets the caller verify the filter is calibrated for their app before trusting `actionableCounts[]`.",
        +  "type": "boolean"
        +}
      • addedInput schema / properties / sortBy
        Added value: +{
        +  "default": "count",
        +  "description": "v1.14+. Ranks the topN by either instance count (default, preserves v1.13 behavior) or total bytes (FLEX's 'Size' sort). totalBytes is `count * instanceSizeBytes` and is the right rank for 'where is my memory going?' investigations vs 'how many instances are alive?'. Per-class instanceSizeBytes + totalBytes are returned regardless of sort key.",
        +  "enum": [
        +    "count",
        +    "totalBytes"
        +  ],
        +  "type": "string"
        +}
      • addedInput schema / properties / unsuppressClassPatterns
        Added value: +{
        +  "description": "v1.17 B-10. Regex patterns that override the noise filter. Use when the default filter false-positives an actionable class (e.g. your app's `NSMutableDictionary` subclass is the actual leak site, or you want CFString back on the actionable list for a string-budget investigation).",
        +  "items": {
        +    "minLength": 1,
        +    "type": "string"
        +  },
        +  "type": "array"
        +}
    • AddeddetectLeaksInXCTest
    • ChangeddetectLeaksInXCUITest1 field changed
      • addedInput schema / properties / outputHtmlPath
        Added value: +{
        +  "description": "Absolute path to write a self-contained HTML report (inline CSS, no external assets). When set, the response also gains an `htmlReportPath` field pointing at the same file. Designed for CI artifact upload + PR-comment attachment.",
        +  "type": "string"
        +}
    • ChangeddiffMemgraphs1 field changed
      • addedInput schema / properties / outputFormat
        Added value: +{
        +  "description": "Response format. Omitted or `json` (default, preserves v1.8 behavior) returns JSON.stringify of the result. `markdown` renders a human-readable view of the same data. `both` returns both content items in one response, so a client can display markdown to the user and parse JSON for the agent loop without a second call. `verify-fix-table` (v1.10, applies to `analyzeAbandonedMemory` and `diffMemgraphs`) emits a focused 4-column markdown comparison table (Class | Before | After | Delta) of the actionable rows; other tools fall back to `markdown` for this value.",
        +  "enum": [
        +    "markdown",
        +    "json",
        +    "both",
        +    "verify-fix-table"
        +  ],
        +  "type": "string"
        +}
    • ChangedfindRetainers1 field changed
      • addedInput schema / properties / includeReferenceTree
        Added value: +{
        +  "default": false,
        +  "description": "v1.12+. When true, also run `leaks --debug=stacks --debug='<className>$'` to surface per-instance allocation stacks aggregated by call-stack fingerprint. Required on memgraphs where `leakCount: 0` and the class is reachable from KVO/NotificationCenter/caches (abandoned-memory shape). Each chain returns the allocation call stack + the unique retainer classes + a representative instance address. **Note:** `leaks --debug=stacks` only emits blocks for instances whose allocation stack was recorded, which requires the target was launched with `MallocStackLogging=1`. Xcode's Memory Graph Debugger export does NOT enable MSL by default, so memgraphs captured that way may surface fewer chains than the total instance count from `analyzeMemgraph.abandonedMemorySuspects[]`. Default false preserves v1.11 behavior.",
        +  "type": "boolean"
        +}
    • AddedinspectTrace
    • AddedrecordViaInstrumentsApp
    • AddedreplayScenario
    • AddedsummarizeTrace
    • ChangedverifyFix2 fields changed
      • addedInput schema / properties / disableDefaultWhitelist
        Added value: +{
        +  "default": false,
        +  "description": "v1.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.",
        +  "type": "boolean"
        +}
      • addedInput schema / properties / expectedAliveClasses
        Added value: +{
        +  "description": "v1.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.\n\nEach 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:\n- `exact`: case-insensitive full-string equality. Use for system class names that are stable.\n- `substring`: case-insensitive substring match (the v1.14 default).\n- `regex`: JavaScript regex (anchors / flags as written in the pattern). Use for nuanced class-name shapes.\n\nMerged with the curated default list (DebugSwift's ignoredViewControllerClassNames + ignoredViewClassNames + ignoredWindowClassNames, all `mode: \"exact\"`) unless `disableDefaultWhitelist: true`.",
        +  "items": {
        +    "anyOf": [
        +      {
        +        "minLength": 1,
        +        "type": "string"
        +      },
        +      {
        +        "additionalProperties": false,
        +        "properties": {
        +          "mode": {
        +            "default": "substring",
        +            "enum": [
        +              "exact",
        +              "substring",
        +              "regex"
        +            ],
        +            "type": "string"
        +          },
        +          "pattern": {
        +            "minLength": 1,
        +            "type": "string"
        +          }
        +        },
        +        "required": [
        +          "pattern"
        +        ],
        +        "type": "object"
        +      }
        +    ]
        +  },
        +  "type": "array"
        +}
  2. 28 tool updatesv1.7.0
    • First observedanalyzeAllocations
    • First observedanalyzeAnimationHitches
    • First observedanalyzeAppLaunch
    • First observedanalyzeHangs
    • First observedanalyzeMemgraph
    • First observedanalyzeTimeProfile
    • First observedcaptureMemgraph
    • First observedclassifyCycle
    • First observedcompareTracesByPattern
    • First observedcountAlive
    • First observeddetectLeaksInXCUITest
    • First observeddiffMemgraphs
    • First observedfindCycles
    • First observedfindRetainers
    • First observedgetInvestigationPlaybook
    • First observedlistTraceDevices
    • First observedlistTraceTemplates
    • First observedlogShow
    • First observedlogStream
    • First observedreachableFromCycle
    • First observedrecordTimeProfile
    • First observedrenderCycleGraph
    • First observedswiftFindSymbolReferences
    • First observedswiftGetHoverInfo
    • First observedswiftGetSymbolDefinition
    • First observedswiftGetSymbolsOverview
    • First observedswiftSearchPattern
    • First observedverifyFix

TDQS

A4/5.0
Disambiguation4/5

Most tools have clearly distinct purposes, but there is some overlap among memory analysis tools (e.g., analyzeMemgraph, classifyCycle, findCycles, findRetainers) which could be confusing despite their specific roles.

Naming Consistency5/5

All tools follow a consistent PascalCase naming convention with a verb+object pattern (e.g., captureMemgraph, classifyCycle, diffMemgraphs). The names are predictable and descriptive.

Tool Count3/5

28 tools is on the higher side but still reasonable given the diverse domains covered (memory, trace, code, logging, CI). Some tools could potentially be merged, but overall each serves a distinct purpose.

Completeness5/5

The toolset provides comprehensive coverage for memory debugging and performance analysis: capture, analyze, classify, diff, verify, code investigation, logging, and CI integration. There are no obvious gaps for the intended domain.

Maintenance

ActivityInactive
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    Local-first CLI and MCP server for turning Xcode Instruments artifacts into bounded, agent-sized evidence, with support for analyses like Time Profiler, Allocations, Network, and more.
    2
    MIT
  • F
    license
    Not graded
    quality
    F
    maintenance
    MCP server that provides semantic-level analysis of Swift codebases to AI agents by integrating with Apple's SourceKit-LSP, enabling compiler-grade code understanding and cross-file navigation.
    126
    -
  • F
    license
    A
    quality
    B
    maintenance
    Enables natural language profiling of iOS apps using xctrace (Instruments) for performance analysis like launch time, memory leaks, CPU usage, and network requests.
    12
    -

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