Skip to main content
Glama

Audit page performance

audit-performance
Read-onlyIdempotent

Measure a page’s lab Web Vitals in headless Chromium, compare results against Google thresholds or custom budgets, and identify LCP elements, layout shifts, and render-blocking requests.

Instructions

Measure a page's lab Web Vitals (LCP, CLS, TBT, FCP, TTFB, and INP when actions interact) in headless Chromium, optionally as a throttled phone and as the median of several runs. Rates them against Google thresholds or your budgets, names the LCP element and shifting elements as verified locators, lists heavy and render-blocking requests, and returns a budget check for the spec. Accepts storageState/headers/actions/routes.

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": {
      "url": "<url>"
    },
    "name": "audit-performance"
  }
}

Input Schema

NameRequiredDescriptionDefault
harNo
urlYesFull URL of the page to measure (http/https)
runsNoLoad the page this many times and report the median (default 1)
deviceNoPlaywright device preset, e.g. 'iPhone 15', 'Pixel 7', 'iPad Pro 11' (viewport, user agent, touch)
routesNoNetwork mocks, first match wins: json/body/status fulfil, abort fails, delayMs alone slows the real request
actionsNoSteps run in order after load to reach a state (modal, step 3). One call = one fresh browser, so include the login steps; end with a 'wait' on what the state shows
browserNoEngine (default chromium)
budgetsNoFail the audit when a metric exceeds its budget (default: rate against Google thresholds)
channelNoBranded Chromium to launch instead of the bundled one (must be installed)
connectNoRemote browser: Playwright ws(s):// endpoint or 'cdp:<url>'; keys as {{env:E2E_…}}
headersNoExtra HTTP headers, e.g. Authorization
offlineNoGo offline once the page has loaded, before steps run, to check offline and retry states
waitForNoWait for this selector first
settleMsNoKeep observing after load for late paints and shifts (default 1500)
throttleNo'mobile': phone viewport, 4x CPU slowdown and slow 4G like Lighthouse mobile; 'none' (default): desktop, unthrottled
viewportNo
timeoutMsNoLimit per run in ms (default 60000)
waitUntilNoNavigation wait condition (default load)
blockWritesNoAbort POST/PUT/PATCH/DELETE requests no mock answers, so steps cannot change real data (default: PW_MCP_BLOCK_WRITES)
cpuSlowdownNoOverride the CPU slowdown factor
projectRootNoProject whose Playwright launches the browser (default: server root)
storageStateNoLogged-in session: storageState JSON inside the project, e.g. playwright/.auth/user.json
blockResourcesNoSkip these requests for speed and privacy: image, media, font, stylesheet, trackers (known analytics/ad hosts); default PW_MCP_BLOCK_RESOURCES
actionTimeoutMsNoHow long each action waits for its element (default 10000); keep timeoutMs above the total

Output Schema

NameRequiredDescriptionDefault
okYesfalse when the call failed (see error) or the tests it ran failed
urlNo
errorNo
metricsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.14.0
    • addedInput schema / properties / blockResources
      Added value: +{
      +  "description": "Skip these requests for speed and privacy: image, media, font, stylesheet, trackers (known analytics/ad hosts); default PW_MCP_BLOCK_RESOURCES",
      +  "items": {
      +    "enum": [
      +      "image",
      +      "media",
      +      "font",
      +      "stylesheet",
      +      "trackers"
      +    ],
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
    • addedInput schema / properties / offline
      Added value: +{
      +  "description": "Go offline once the page has loaded, before steps run, to check offline and retry states",
      +  "type": "boolean"
      +}
  2. Changed20 schema fields changedv0.13.0
    • removedInput schema / $schema
      Removed value: -"https://json-schema.org/draft/2020-12/schema"
    • removedInput schema / additionalProperties
      Removed value: -{}
    • changedInput schema / properties / actions / items / properties / type / enum
      Previous value: -[
      -  "goto",
      -  "click",
      -  "dblclick",
      -  "hover",
      -  "fill",
      -  "press",
      -  "check",
      -  "uncheck",
      -  "select",
      -  "wait"
      -]New value: +[
      +  "goto",
      +  "click",
      +  "dblclick",
      +  "hover",
      +  "fill",
      +  "press",
      +  "check",
      +  "uncheck",
      +  "select",
      +  "wait",
      +  "switchTab"
      +]
    • changedInput schema / properties / actions / items / properties / value / description
      Previous value: -"fill text, press key, select option"New value: +"fill text, press key, select option; switchTab: 'last' (default), 'first', a 1-based number, or text in the tab's URL or title"
    • removedInput schema / properties / actions / maxItems
      Removed value: -20
    • addedInput schema / properties / blockWrites
      Added value: +{
      +  "description": "Abort POST/PUT/PATCH/DELETE requests no mock answers, so steps cannot change real data (default: PW_MCP_BLOCK_WRITES)",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / connect
      Added value: +{
      +  "description": "Remote browser: Playwright ws(s):// endpoint or 'cdp:<url>'; keys as {{env:E2E_…}}",
      +  "type": "string"
      +}
    • removedInput schema / properties / device / maxLength
      Removed value: -60
    • removedInput schema / properties / device / minLength
      Removed value: -2
    • removedInput schema / properties / har / properties / path / maxLength
      Removed value: -500
    • removedInput schema / properties / har / properties / path / minLength
      Removed value: -1
    • removedInput schema / properties / har / properties / url / maxLength
      Removed value: -500
    • removedInput schema / properties / headers / propertyNames
      Removed value: -{
      -  "type": "string"
      -}
    • removedInput schema / properties / routes / items / properties / body / maxLength
      Removed value: -200000
    • removedInput schema / properties / routes / items / properties / contentType / maxLength
      Removed value: -100
    • removedInput schema / properties / routes / items / properties / headers / propertyNames
      Removed value: -{
      -  "type": "string"
      -}
    • removedInput schema / properties / routes / items / properties / method / maxLength
      Removed value: -10
    • removedInput schema / properties / routes / items / properties / url / maxLength
      Removed value: -500
    • removedInput schema / properties / routes / items / properties / url / minLength
      Removed value: -1
    • removedInput schema / properties / routes / maxItems
      Removed value: -20
  3. Addedv0.6.1

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already grant readOnlyHint/idempotentHint, so safety is covered; the description adds real value by disclosing that it names the LCP element and shifting elements as verified locators, lists render-blocking requests, and returns a spec budget check. Minor tension: it says 'headless Chromium' while the schema exposes firefox/webkit and branded channels, but this reads as the default rather than a hard constraint.

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?

One dense but front-loaded paragraph: purpose and metrics come first, then outputs, then a param hint. The closing 'Accepts storageState/headers/actions/routes.' is a low-value list dump that duplicates the schema, but nothing else is wasted.

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?

With 24 parameters, an output schema present, and 92% schema coverage, the description need only orient the agent; it does that by explaining what gets measured, what gets reported, and how budgets alter behavior. The absence of explicit sibling routing guidance is the main gap, not any missing call mechanics.

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 92%, so the schema already documents nearly all 24 parameters in detail. The description's only parameter-level contribution is the trailing 'Accepts storageState/headers/actions/routes' and the 'INP when actions interact' note, which add little beyond what the schema says. Baseline 3 is 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?

Names a specific verb and resource (measure a page's lab Web Vitals in headless Chromium) and immediately enumerates the metrics (LCP, CLS, TBT, FCP, TTFB, INP), which distinguishes it from audit-accessibility and compare-visual-state without any ambiguity.

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?

Gives implied context ('optionally as a throttled phone and as the median of several runs') but never states when to pick this over audit-accessibility, compare-visual-state, or run-test. The agent is left to infer that this is the performance-measurement tool from the purpose sentence alone.

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