Skip to main content
Glama

memory.heap.compare

Read-only

Compare two heap snapshots by constructor to show which objects grew or shrank and how many detached DOM nodes accumulated, helping identify memory leaks.

Instructions

Diff two heap snapshots by constructor: what grew, what shrank, and how many detached DOM nodes accumulated. This is how leaks get found.

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": {
      "before_artifact_id": "<before_artifact_id>",
      "after_artifact_id": "<after_artifact_id>"
    },
    "name": "memory.heap.compare"
  }
}

Input Schema

NameRequiredDescriptionDefault
topNo
after_artifact_idYes
before_artifact_idYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true and openWorldHint=true, so the safety profile is covered. The description adds genuinely useful behavior beyond that — the comparison is grouped by constructor and includes detached DOM node counts — but is silent on preconditions (artifact IDs must reference existing snapshots) and on the fact that large snapshots make this an expensive operation.

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?

Two short sentences, front-loaded with the operation and its output dimensions, with no redundant or filler wording. The closing clause adds usage framing rather than restating the name.

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?

With no output schema and no annotation coverage of prerequisites, the description should say more about what the comparison returns and what must exist beforehand. It adequately characterizes the comparison's content but is incomplete on parameter meaning and the required prior snapshot artifacts.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description carries the full burden, yet it never mentions the parameters. It only weakly implies the before/after artifact IDs via 'diff two heap snapshots,' and gives no clue what 'top' controls (presumably limiting ranked results). This is a substantial compensation gap for a 3-parameter tool.

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 specific verb (diff) and resource (two heap snapshots) plus the comparison key (by constructor) and the concrete output dimensions: growth, shrink, and detached DOM node accumulation. This is clearly distinguishable from the sibling memory.heap.snapshot, which captures rather than compares.

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?

'This is how leaks get found' signals the intended diagnostic scenario (memory-leak hunting), which is real usage context. However, it never explicitly says when to pick this over memory.usage or memory.heap.snapshot, nor what prerequisites exist (both snapshots must already be captured), leaving the agent to infer the workflow.

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