Skip to main content
Glama

Audit page performance

audit-performance
Read-onlyIdempotent

Measure a page's lab Web Vitals in headless Chromium, compare results with 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.

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)
headersNoExtra HTTP headers, e.g. Authorization
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)
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
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. 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 declare readOnlyHint/openWorldHint/idempotentHint, and the description adds meaningful context beyond them: this is a lab (headless Chromium) measurement, INP is only reported 'when actions interact', and results include rated verdicts against Google thresholds or custom budgets. It stops short of disclosing cost/runtime (each call launches a browser, so multi-run audits are slow) or that it requires a Playwright project context.

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?

Effectively one long sentence that front-loads the verb, the measured metrics, and the outputs before trailing capabilities, which is well adapted to a 20-parameter tool. It is dense and slightly run-on, and 'in headless Chromium' partially duplicates the browser parameter, but nothing 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?

An output schema exists, yet the description still usefully previews what comes back (ratings, locators, request lists, budget verdict) and covers measurement conditions and the optional auth/mock/interaction inputs. It omits practical prerequisites (a Playwright project root, long runtimes for multi-run medians) that an agent would want before invoking it repeatedly.

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 90%, so the schema already carries the parameter documentation burden. The description calls out useful capability clusters (storageState/headers for auth, actions for reaching state, routes for mocking, throttled phone, median of runs), but it adds no syntax or constraint detail beyond what the schema already says. Baseline 3 applies.

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 and resource ('Measure a page's lab Web Vitals') and enumerates the exact metrics plus the derived artifacts (LCP element locators, shifting elements, heavy/render-blocking requests, budget check). This is clearly distinguishable from siblings like audit-accessibility, inspect-page, and run-test.

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?

Usage is only implied: the mention of budgets and 'the spec' hints at CI/pre-ship gating and the throttled/median options hint at mobile profiles, but the description never says when to choose this over audit-accessibility or run-test, nor does it state prerequisites or exclusions. An agent must infer the fitting scenario.

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