Skip to main content
Glama
carloshpdoc

memorydetective

Render a retain cycle as Mermaid or DOT graph

renderCycleGraph

Read a .memgraph file, pick a retain cycle by index, and render it as a Mermaid or Graphviz graph highlighting app classes and cycle terminators.

Instructions

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

Input Schema

TableJSON 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.
Behavior3/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 explains the tool reads a file and outputs a graph, but it does not mention side effects, error conditions, or prerequisites (e.g., file existence). The description is adequate but lacks detail on what happens if the file is missing or the cycle index is out of range.

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 three sentences long, front-loading the core purpose and key features. Every sentence provides necessary information without redundancy. It is highly concise and 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 the tool has 5 parameters, no output schema, and no annotations, the description does a good job explaining the input, output format (Mermaid or DOT), and styling highlights. It could be more complete by mentioning that the output is a string, but overall it is sufficient for an agent to use the tool correctly.

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?

All 5 parameters have schema descriptions (100% coverage), so the baseline is 3. The description adds value by reiterating the use of `cycleIndex` and implying that cycle 0 is typically the largest. This extra context helps the agent understand parameter intent 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 specifies the tool reads a .memgraph file, selects a root cycle by index, and outputs a graph in Mermaid or DOT format. It also mentions highlighting and distinct styling for back references, making the purpose very clear. Sibling tools like findCycles or classifyCycle have different functions, so this tool is well-distinguished.

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 mentions using `cycleIndex` to render cycles other than the first, which provides clear usage guidance. However, it does not explicitly state when to use this tool versus other sibling tools, or when not to use it. The context is clear enough for an agent to infer that this tool is used for visualization after cycle detection.

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