Skip to main content
Glama

browser_memory_check

Detect memory leaks in browser sessions by measuring detached DOM nodes, event listener risks, heap size, and DOM node count, providing risk assessment and optimization suggestions.

Instructions

Memory leak detection: via Performance API, measures detached DOM node count, event-listener leak risk, JS heap size, and total DOM node count, returning a leak-risk assessment and optimization suggestions.

中文详情:

  • 用途:内存泄漏检测,通过 Performance API 检测 detached DOM 节点数量、事件监听器泄漏风险、JS 堆大小和 DOM 节点总数,返回泄漏风险评估和优化建议

  • 何时使用:SPA 长时间运行内存增长排查时;路由切换后 DOM 节点未释放验证时;事件监听器泄漏排查时;上线前内存基线评估时

  • 输出:{ ok: boolean, heapSize: number, heapUsed: number, domNodeCount: number, detachedDomCount: number, listenerLeakRisk: boolean, riskLevel: string, recommendations: array }

  • 参数:

    • sessionName (string, 可选):浏览器会话名称,默认当前活跃会话

  • 错误:浏览器未启动抛出 'Browser not launched';Performance API 不可用抛出 'Performance API not available'

  • 示例:{"sessionName":"long-running-session"}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sessionNameNo浏览器会话名称,默认当前活跃会话
Behavior3/5

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

No annotations are provided, so the description must fully disclose behavioral traits. It lists error conditions and output structure, but does not explicitly state whether the tool is read-only (e.g., 'Does not modify browser state'). Given the nature of Performance API calls, it is likely safe, but the description misses the opportunity to confirm non-destructiveness.

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?

The description is well-structured with clear sections (purpose, when-to-use, output, parameters, errors, example). It is front-loaded with an English summary followed by Chinese details. The redundancy between languages slightly reduces conciseness, but overall it is efficient and easy to scan.

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?

For a tool with one optional parameter and no output schema, the description is remarkably complete. It covers the return value structure, possible errors, and explicit use cases. No additional information is needed for an agent to use this tool effectively.

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 the 'sessionName' parameter. The description adds marginal value by repeating the parameter's purpose and noting it is optional with a default, and provides an example. This is sufficient but not above the baseline for high coverage.

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's purpose: 'Memory leak detection: via Performance API, measures detached DOM node count, event-listener leak risk, JS heap size, and total DOM node count'. It provides a specific verb ('detect') and resource ('memory leak'), and distinguishes itself from sibling tools like browser_performance or browser_performance_check by focusing solely on memory leak diagnostics.

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 description includes explicit usage scenarios in Chinese: 'SPA长时间运行内存增长排查时;路由切换后DOM节点未释放验证时;事件监听器泄漏排查时;上线前内存基线评估时'. This provides clear context for when to use the tool. However, it does not mention when not to use it or suggest alternative tools, which would improve differentiation from siblings like browser_performance_check.

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/validpilot/ai-verify-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server