Skip to main content
Glama
carloshpdoc

memorydetective

Find what retains a class

findRetainers

Identify what retains a specific class by walking the cycle forest of a .memgraph file. Returns all retain chains ending in nodes matching the given class substring.

Instructions

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

Input Schema

TableJSON 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).
Behavior4/5

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

With no annotations, the description discloses key behavioral traits: it walks a cycle forest, returns retain chains ending in a node matching the substring, and returns paths from a top-level node. It does not mention any destructive effects or auth requirements, which is appropriate for a read-only 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, front-loaded with the core action and a clear use case. Every sentence adds value, 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?

Given no output schema, the description explains the return value ('returns paths from a top-level node down to the matching node'). It covers the tool's purpose, parameters, and output adequately for an analysis tool, and differentiates from similar siblings.

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 has 100% coverage for all three parameters (path, className, maxResults). The description adds minimal extra meaning beyond the schema, such as clarifying that className is a substring match. Per guidelines, baseline 3 is appropriate when schema coverage is high and description adds little.

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 'Walk the cycle forest... and return every retain chain that ends in a node whose className contains the given substring.' It uses a specific verb (walk, return) and resource (.memgraph), and distinguishes from sibling tools like findCycles and detectLeaksInXCUITest by focusing on retain chains for a specific class substring.

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 'Useful for answering "who is keeping <class> alive?"', which gives clear context for when to use the tool. However, it does not provide explicit when-not or alternative tools, though the sibling list includes other relevant tools (e.g., findCycles) that could be implied.

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