Skip to main content
Glama

take_heapsnapshot

Capture a heap snapshot to analyze JavaScript memory distribution and debug memory leaks in the current page.

Instructions

Capture a heap snapshot of the target page. Use to analyze the memory distribution of JavaScript objects and debug memory leaks.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageIdYesTargets a specific page by ID.
filePathYesA path to a .heapsnapshot file to save the heapsnapshot to.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior3/5

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

Annotations only provide readOnlyHint=false, so the description carries some burden. It implies a side effect by 'capture' and the filePath schema field, but does not state whether existing files are overwritten, whether the page is paused, or how large the snapshot can be. It does not contradict the readOnlyHint=false annotation.

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 sentences front-load the action ('Capture a heap snapshot...') and then give the purpose. There is no redundancy or extraneous information.

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 only two required parameters, full schema coverage, and no output schema, the description covers the core invocation context. It could mention what happens after the snapshot is saved, but that is a minor gap for a low-complexity tool.

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 schema already documents pageId and filePath. The description adds no specific parameter guidance beyond the general memory-analysis purpose. Baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description names a specific action and object: 'Capture a heap snapshot of the target page.' It also clarifies the domain (JavaScript memory distribution), which helps distinguish it from sibling tools like take_snapshot and evaluate_script. It does not explicitly contrast with siblings, so it is clear but not fully differentiated.

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 second sentence states an explicit intended use case: analyze memory distribution of JavaScript objects and debug memory leaks. This gives the agent clear context for when to choose this tool, though it stops short of naming alternatives or when-not-to-use conditions. It is above merely implied usage.

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