Skip to main content
Glama

run_lighthouse

Runs a real Google Lighthouse audit and returns category scores, Core Web Vitals, failed audits, median-run spread, and prioritized savings to diagnose page performance.

Instructions

Run a real Google Lighthouse audit: 0-100 category scores, Core Web Vitals, failed audits, and a SUMMARY an agent otherwise computes by hand — LCP element + phase breakdown (TTFB / load delay / load time / render delay), TTFB with a >2 s warning, transfer bytes by domain with third-party share, top opportunities by savings. runs=N gives the median run plus min/median/max spread; warmup=true primes server caches first. Full JSON report(s) saved to data/reports/. Requires Node.js (npm i -g lighthouse or npx). Runs its own Chrome — no session/auth state

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": "run_lighthouse"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlYesURL to audit
runsNoRun Lighthouse N times (1-5, default 1) and report the median-LCP run plus a min/median/max spread — use 3 for comparisons (staging vs live, before/after)
deviceNoEmulation preset (default: mobile, like Lighthouse's default)
warmupNoOne plain GET before the runs to prime server-side page caches (WP Rocket, CDN), so a cold-cache TTFB doesn't poison the comparison (default: false)
timeoutNoMax seconds to wait per run (default: 180)
categoriesNoCategories to audit (default: all four)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.12.0
    • addedInput schema / properties / runs
      Added value: +{
      +  "description": "Run Lighthouse N times (1-5, default 1) and report the median-LCP run plus a min/median/max spread — use 3 for comparisons (staging vs live, before/after)",
      +  "type": "integer"
      +}
    • changedInput schema / properties / timeout / description
      Previous value: -"Max seconds to wait (default: 180)"New value: +"Max seconds to wait per run (default: 180)"
    • addedInput schema / properties / warmup
      Added value: +{
      +  "description": "One plain GET before the runs to prime server-side page caches (WP Rocket, CDN), so a cold-cache TTFB doesn't poison the comparison (default: false)",
      +  "type": [
      +    "boolean",
      +    "string"
      +  ]
      +}
  2. First observedv0.1.0

TDQS

A4.1/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does so well: runtime prerequisite (Node.js via npm i -g or npx), independence from browser sessions/auth state, side effect of writing full JSON reports to data/reports/, and a default per-run timeout. It omits failure modes and expected runtime duration for multi-run audits, which keeps it short of a 5.

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?

Front-loaded with the verb and resource, then the differentiators an agent needs (summary content, multi-run behavior, prerequisites, isolation from sessions). Dense parenthetical phrasing is efficient rather than padded; no sentence is redundant.

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?

No output schema exists, so the description must describe return values — and it does, listing category scores, Core Web Vitals, failed audits, the LCP/TTFB/byte/opportunity summary, and where raw reports land. For a complex, prerequisite-heavy tool this is sufficient for an agent to call it correctly on the first try.

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 all six parameters are already documented with defaults and enums. The description largely restates that ground (median run plus min/median/max spread, warmup priming caches) rather than adding new semantics such as valid ranges, interaction between categories and scores, or timeout consequences.

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?

The description names a specific verb and resource ('Run a real Google Lighthouse audit') and enumerates the concrete outputs (scores, Core Web Vitals, failed audits, LCP phase breakdown). It implicitly separates itself from session-based siblings via 'Runs its own Chrome — no session/auth state,' but never names an alternative explicitly, so full sibling differentiation is only inferred.

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?

Gives actionable context: 'use 3 for comparisons (staging vs live, before/after)' for runs, and explains when warmup is warranted (cold-cache TTFB poisoning a comparison). It never states when NOT to use this tool or which sibling to prefer for session-aware checks, so the routing guidance is contextual rather than complete.

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