analyze_page¶
Analyze a single URL with the Google PageSpeed Insights API.
Parameters¶
| Parameter | Type | Required | Description |
|---|---|---|---|
url |
string | Yes | The full URL to analyze (include https://) |
strategy |
string | No | "mobile" (default), "desktop", or "both" |
strategy=\"both\" -- latency warning
Using strategy="both" makes two sequential API calls -- one mobile, one desktop. The PSI API can take 5-20+ seconds per call. On a slow or complex page, strategy="both" can easily take 30+ seconds, approaching the timeout limit of most MCP clients. Use "mobile" or "desktop" for interactive use. Reserve "both" for pages you know respond quickly.
Response¶
The tool returns a structured result with the following sections for each strategy analyzed:
Category Scores¶
Overall Lighthouse category scores (0-100):
performance-- overall performance scoreseo-- SEO audit scoreaccessibility-- accessibility scorebestPractices-- best practices score
Core Web Vitals¶
Each metric includes a numeric value and a rating:
| Field | Description |
|---|---|
lcp |
Largest Contentful Paint (seconds) |
cls |
Cumulative Layout Shift (unitless score) |
fcp |
First Contentful Paint (seconds) |
ttfb |
Time to First Byte (seconds) |
tbt |
Total Blocking Time (milliseconds) |
speedIndex |
Speed Index (seconds) |
Each has a rating field: "good", "needs-improvement", or "poor".
Opportunities¶
A list of improvements the page could make, each with:
id-- the Lighthouse audit IDtitle-- human-readable descriptiondescription-- detailed explanationestimatedSavings-- estimated time savings if addressed (seconds)
Failing Audits¶
Audits the page did not pass:
id,title,description-- same structure as opportunitiesdisplayValue-- the measured value (e.g., "3 elements")
Passed Audits¶
List of audit IDs that passed, for reference.