Skip to main content
Glama
carloshpdoc

memorydetective

Capture a .memgraph from a running process

captureMemgraph

Capture a memory graph snapshot from a running process by specifying its PID or app name, writing a .memgraph file for analysis of local Mac and iOS simulator processes.

Instructions

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

Input Schema

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

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

No annotations are provided, so the description carries full behavioral burden. It discloses the mechanism (resolve appName to PID via pgrep -x), platform limitations, and the fact it wraps a diagnostic tool. It does not explicitly state non-destructive behavior but implies it by referencing a read-only snapshot tool. More explicit mention of safety could raise the score.

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 two sentences plus a bold limitation note. Every sentence adds value, and key information is front-loaded. No redundant text.

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 sufficient context: purpose, resolution method, platform constraints, and limitations. It does not detail output format but that is acceptable for a capture tool. The description is complete enough for an agent to use 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?

Schema coverage is 100% with parameter descriptions. The description adds value beyond schema by explaining the mutual exclusivity of pid/appName, the resolution logic (pgrep -x), and the output path requirement (must end in .memgraph). This enhances understanding of parameter usage.

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 captures a .memgraph snapshot from a running process, using a wrapper around `leaks --outputGraph`. It distinguishes itself from sibling tools by being the only capture tool among analysis tools, and the limitation section further clarifies its scope.

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 when to use the tool (local Mac processes, including iOS simulator) and when not to (physical iOS devices), providing an alternative (Xcode's Memory Graph button). This gives clear guidance on tool selection.

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