Skip to main content
Glama
kengrary

JVMind MAT Heap Dump Analyzer

Path to GC roots

mat_path2gc
Read-onlyIdempotent

Find the shortest reference chains from an object to GC roots to explain why it remains reachable and is not garbage collected.

Instructions

Read-only, synchronous lookup of the shortest reference chains from one object to GC roots, explaining why that object is still reachable and not collected. Returns up to five linear paths plus MAT's path tree. Typical flow: get an object id from mat_object, mat_histogram, mat_dominator, or a mat_leak_suspects preferredObjectId, confirm it with mat_object, then call this tool. Use mat_dominator instead when you want to know which object retains an entire subtree; use mat_leak_suspects when you do not yet have a specific object. Requires the report_id of a parsed dump (status=DONE).

Input Schema

NameRequiredDescriptionDefault
objectYesMAT object id as a decimal integer, copied from the objectId / preferredObjectId field of mat_object, mat_histogram, mat_dominator, or mat_leak_suspects. This endpoint does not accept 0x-prefixed hex.
report_idYesReport ID returned by open_heapdump or dump_java_heap; the dump must have finished parsing (status must be DONE).
excludeWeakSoftNotrue (default) ignores paths through weak, soft, and phantom references, so only strong references that actually pin the object are shown. false includes reference types the GC may clear.

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.1.1
    • addedInput schema / properties / excludeWeakSoft / description
      Added value: +"true (default) ignores paths through weak, soft, and phantom references, so only strong references that actually pin the object are shown. false includes reference types the GC may clear."
    • addedInput schema / properties / object / description
      Added value: +"MAT object id as a decimal integer, copied from the objectId / preferredObjectId field of mat_object, mat_histogram, mat_dominator, or mat_leak_suspects. This endpoint does not accept 0x-prefixed hex."
    • addedInput schema / properties / report_id / description
      Added value: +"Report ID returned by open_heapdump or dump_java_heap; the dump must have finished parsing (status must be DONE)."
  2. First observedv0.1.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnly/idempotent/closed-world, but the description adds real behavioral context: synchronous execution, the prerequisite that the dump be parsed (status=DONE), and the result shape (up to five linear paths plus MAT's path tree). It doesn't discuss cost/latency on very large heaps, which keeps it short of a 5.

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?

Front-loaded and dense with no filler sentences, but it is a single packed paragraph where the upstream-flow sentence partially repeats ids of tools already listed in the alternative sentence; slightly trimming would improve scanability.

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?

With an output schema, full param coverage, and safety annotations already present, the description covers exactly what structure can't: prerequisite state, upstream source of the identifier, and sibling routing.

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 object/report_id/excludeWeakSoft semantics are already fully documented, including the no-hex-id constraint and the weak/soft reference behavior. The description only restates where object ids come from, adding little 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?

States a concrete verb and resource ("shortest reference chains from one object to GC roots") plus the intent (explain why the object is still reachable), which an agent can distinguish from mat_dominator or mat_leak_suspects without opening a schema.

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?

Gives an explicit upstream flow (obtain an id from mat_object/mat_histogram/mat_dominator/mat_leak_suspects, confirm with mat_object, then call this) and names two alternatives with the conditions that select them (mat_dominator for subtree retention, mat_leak_suspects when no specific object exists).

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