Skip to main content
Glama

adb_heap_dump

Capture a heap dump from a running Android process for memory analysis, then retrieve the .hprof file. Provide a PID or package name to select the target.

Instructions

Capture a heap dump from a running process for memory analysis. Triggers am dumpheap and pulls the resulting .hprof file. Requires the target process PID or package name.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "target": "<target>"
    },
    "name": "adb_heap_dump"
  }
}

Input Schema

NameRequiredDescriptionDefault
deviceNoDevice serial
targetYesProcess PID (number) or package name (e.g., com.example.app)
filenameNoOutput filename (default: heap_<target>_<timestamp>.hprof)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.1.6
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
  2. Changed1 schema field changedv1.1.3
    • removedInput schema / additionalProperties
      Removed value: -false
  3. First observedv1.1.1

TDQS

A3.7/5.0
Behavior3/5

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

With no annotations, the description carries the full behavioral burden. It usefully discloses the mechanism ('Triggers `am dumpheap` and pulls the resulting .hprof file'), but it omits important operational details such as whether the app must be debuggable, whether root is required, whether the call blocks, and where the file is written.

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?

Three short sentences, each carrying distinct information: purpose, mechanism, and required input. The purpose is front-loaded and there is no redundant or filler wording.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description is adequate for a simple three-parameter tool, but with no output schema and no annotations it should do more to explain return behavior (e.g., the .hprof path) and execution prerequisites such as debuggable apps or root access.

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 input schema already explains the device, target, and filename parameters. The description repeats the target requirement but does not add syntax, format, or default behavior beyond what the schema provides, making the baseline 3 appropriate.

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 uses a specific verb and resource: 'Capture a heap dump from a running process.' It clearly distinguishes this from sibling tools like adb_dumpsys or adb_perf_snapshot by naming the artifact (.hprof) and the underlying command.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives implied usage context ('for memory analysis') and states that a target PID or package is required, but it does not say when to choose this over alternatives such as adb_dumpsys, adb_perf_snapshot, or adb_top, nor does it list exclusions or prerequisites.

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

Deploy Server

Other Tools