Skip to main content
Glama
Considus

pagespeed-insights-mcp

Analyse a page

analyse_page

Measure a web page's lab performance and identify what to fix using median scores, ranked failing audits, real-user data, and a shareable HTML report.

Instructions

Use to measure a page in the lab and find what to fix (scores with their spread, failing audits ranked by what fixing them is worth, real-user data beside them, and a page to send on); for real-user data alone use get_field_data, which is fast, and for "did that change help" use compare_to_baseline. include picks the parts, "scores", "issues", "field_data" and "html", default all four. ONE MEASUREMENT SERVES EVERY PART, so asking for more costs no extra API calls, while asking in separate calls measures again. SLOW, several minutes. It reports the MEDIAN of several DISTINCT analyses with the min-max spread, so the number comes with its uncertainty. A single Lighthouse run is noise, Total Blocking Time swings threefold between runs on an unchanged page, so runs=1 is fast but its score is not a reliable figure. Google re-analyses a URL only about once a minute and replays the cached result in between, so this keeps asking until it has genuinely different analyses rather than the same one several times. That means runs=5 takes roughly 150 seconds and asking harder will NOT speed it up. Reports fewer analyses honestly if time runs out. Anything that will not fit inside one tool call returns a JOB ID instead and keeps working: collect it with get_job_result, polling about every 15 seconds. Only runs=1 on a single URL with include ["scores"] answers immediately, and that is the noisy single run described above. ISSUES are what is FAILING on the page, from Google's own audit findings and remediation text. Only a fault that failed in EVERY distinct analysis is reported, because audits are as noisy as scores and a one-off failure is the instrument moving rather than a fact about the page. Estimated savings carry their median and spread for the same reason. Ranked by what actually moves the score: the performance score is five metrics and every other performance audit weighs zero, so a big estimated saving on an unweighted diagnostic is not the first thing to fix. Savings do NOT add up, they overlap, so the order is meaningful and the sum is not. FIELD_DATA is real-user data if Google has any. HTML is a complete self-contained page carrying all of it, made to be saved as a file the user can open or forward, because several of the largest findings are usually hosting or third-party decisions that the person running the check cannot fix alone. Set html false if they only want the answer in conversation. TO SAVE IT AS A FILE, pass directory, a folder on the user's own machine that the report is written into. The server writes into whichever existing folder directory names and does not check where that path came from. The folder is checked BEFORE the measurement starts, which takes minutes, so a folder that does not exist or cannot be written to is refused at once. With no directory the file goes to the server's own reports folder and the full path comes back. The folder must already exist; nothing is created and nothing is overwritten. Saved files keep their embedded fonts and are about 150KB; the copy returned in conversation drops them to stay small, so a saved file is the fuller of the two. Returns a readable report and the same figures as JSON.

Input Schema

NameRequiredDescriptionDefault
htmlNoInclude the HTML page in the reply when include has "html". Default true, ignored when saving to a file.
runsNoDISTINCT analyses to collect and median over. Default 5, which takes ~150s, for scores alone, otherwise 3. At least 2 whenever issues or html are included.
urlsNoAbsolute http(s) URLs. Defaults to saved URLs.
includeNoThe parts to return. Default all four. "scores": lab scores and metrics with their spread. "issues": what is failing, ranked. "field_data": real-user data from the Chrome UX Report. "html": the complete report as a self-contained page.
filenameNoFile name only, no slashes and no "..". Defaults to the site and today's date.
strategyNoDefault mobile, which Google ranks on. issues and html are measured on mobile only, so desktop and both need an include without them.
directoryNoAn EXISTING folder to save the report into, which the USER named. Omit to use the server's own reports folder. Needs "html" in include.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv2.0.0

TDQS

A4.7/5.0
Behavior5/5

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

Beyond the annotations, the description discloses the slow multi-minute runtime, median-of-distinct-runs behavior, Google's roughly once-per-minute URL re-analysis and cached-result replay, the estimated ~150 seconds for runs=5, the job-ID fallback with polling guidance, the failure-only rule for issues, non-additive savings, and file-saving behavior including pre-measurement folder validation.

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?

It is front-loaded with purpose and alternatives, but the single long paragraph packs in many secondary details—TBT variance, cached-result mechanics, file size and font differences, path provenance—some of which could be trimmed or separated for scannability.

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 complex seven-parameter tool with no output schema, the description covers return format (readable report plus JSON), job handling, timing expectations, failure semantics, and file-saving behavior thoroughly enough that an agent can call it correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/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 defines each parameter. The description still adds meaningful context: include parts are measured together, runs interacts with caching and time, directory is checked before measurement, and html controls whether the full page is embedded or saved.

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 gives a specific verb and resource ('measure a page in the lab and find what to fix') and clearly distinguishes the tool from its siblings by naming get_field_data for real-user-only data and compare_to_baseline for change validation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It explicitly states when to use this tool versus alternatives, explains that include selects report parts, and warns that separate calls re-measure while one measurement serves every part. The runs=1 fast-path and its unreliability are also spelled out.

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