Skip to main content
Glama

browser_performance_trace

Record a complete browser performance trace including paint, timing, and resource data. Output HAR files and structured metrics like FCP, LCP, and CLS to diagnose front-end performance issues.

Instructions

Record a complete performance trace (paint/timing/resource) and output HAR plus structured performance data. Supports W3C Performance Timeline API to capture FP/FCP/LCP/CLS core metrics.

中文详情:

  • 用途:记录完整的性能轨迹(Paint/Timing/Resource),输出 HAR 格式和结构化性能数据,支持 W3C Performance Timeline API 获取 FP/FCP/LCP/CLS 等核心指标

  • 何时使用:性能瓶颈深度分析时;HAR 文件取证时;前端渲染瀑布图分析时;FCP/LCP 异常排查时

  • 输出:{ ok: boolean, tracePath: string, harPath: string, metrics: object, entries: array, duration: number } — metrics 含 fp/fcp/lcp/cls/tbt;entries 为 PerformanceEntry 列表

  • 参数:

    • url (string, 可选):要追踪性能的目标 URL,不提供则使用当前页面

    • categories (array, 可选):要记录的性能类别,默认 ["navigation","resource","paint","longtask"]

    • duration (number, 可选):追踪持续时间(毫秒),默认 5000

    • enableScreenshots (boolean, 可选):是否在追踪期间定期截图,默认 false

    • exportHar (boolean, 可选):是否导出 HAR 格式数据,默认 true

  • 错误:浏览器未启动抛出 'Browser not launched';duration 过大可能影响响应时间

  • 示例:{"url":"https://example.com","categories":["navigation","paint","longtask"],"duration":10000,"exportHar":true}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlNo要追踪性能的目标 URL。如果不提供则使用当前页面。
durationNo追踪持续时间(毫秒)
exportHarNo是否导出 HAR 格式数据
categoriesNo要记录的性能类别
enableScreenshotsNo是否在追踪期间定期截图
Behavior3/5

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

No annotations provided, so description must fully disclose behavior. It mentions output format, supported metrics, and error scenarios (browser not launched, duration impact). However, it does not state whether the tool is read-only, whether traces persist, or cleanup behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Description includes both English and Chinese sections, causing redundancy. The English part is concise (2 sentences), but the Chinese section repeats and adds details. Could be streamlined without losing clarity.

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?

Tool has 5 optional parameters, no output schema, no nested objects. Description covers purpose, usage, parameters, output structure, and example. Provides enough context for an agent to understand the tool's function and expected results.

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 coverage is 100% with clear descriptions. The description adds minor context (e.g., using current page if URL omitted) but largely repeats schema info. No new meaning beyond what schema already provides.

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?

Clearly states the tool records a complete performance trace and outputs HAR plus structured data. The verb 'Record' and resource 'performance trace' are specific. However, it doesn't differentiate from sibling tools like browser_performance or browser_har_export, which may overlap in purpose.

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?

Explicitly lists use cases in the Chinese section (e.g., deep performance analysis, HAR file forensics). Provides error conditions and an example. However, it doesn't mention when not to use this tool versus alternatives like browser_lighthouse_audit or browser_network_detail.

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