Skip to main content
Glama
carloshpdoc

memorydetective

Analyze a .memgraph file

analyzeMemgraph

Analyzes a .memgraph file to detect retain cycles, providing a structured summary with diagnosis and optional full retain chains.

Instructions

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

Input Schema

TableJSON 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.
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 of behavioral disclosure. It describes the pipeline (`classifyCycle`, `reachableFromCycle`) and the structure of the output. It does not mention side effects or permissions, 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?

The description is two paragraphs, front-loaded with the main purpose. It uses bullet points for pipeline steps. Every sentence adds value; no filler. Slightly long but 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, the description adequately explains the return structure. All 4 parameters are documented in both schema and description. The pipeline context adds completeness. However, it could briefly mention what happens if the file is invalid.

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%, but the description adds value beyond the schema: it explains the effect of `fullChains`, describes verbosity levels, and clarifies the default and purpose of `maxClassesInChain`. This helps the agent choose parameters appropriately.

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 `leaks(1)` against a `.memgraph` file and returns a structured summary including header info, totals, top-level ROOT CYCLE blocks, and plain-English diagnosis. It distinguishes from siblings like `classifyCycle` and `reachableFromCycle` by mentioning the pipeline.

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 guidance on when to use `fullChains: true` to include full retain chains vs default summary mode. It also explains that the response includes `suggestedNextCalls`, enabling chaining without re-reasoning. However, it does not explicitly state when to use this tool over other analysis tools.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

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

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

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