Skip to main content
Glama
PageSpeed Insights MCP Server

PageSpeed Insights MCP Server

Diagnose a Page Performance Problem

pagespeed_diagnose_page
Read-onlyIdempotent

Diagnose one page through a single focus—visual, elements, network, JavaScript, images, render-blocking, or third parties—to gather targeted evidence after analysis flags a performance issue.

Instructions

Inspect one page through exactly one diagnostic lens: visual, elements, network, javascript, images, render-blocking, or third-parties. Use after pagespeed_analyze_page identifies a problem; do not use it for a general score. Example: focus=render-blocking to identify CSS/JS delaying first render. Returns focused evidence (including native image screenshots when focus=visual).

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>",
      "focus": "<focus>"
    },
    "name": "pagespeed_diagnose_page"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlYesPublic or local http(s) URL, for example https://example.com/products or http://localhost:3000.
focusYesThe single diagnostic lens to return.
engineNoAnalysis engine: auto (default, uses local Lighthouse for localhost/private URLs and Google PSI for public URLs), psi, or local.
strategyNoLighthouse device profile. mobile is the default.mobile
extraHeadersNoOptional HTTP headers (for example Authorization or Cookie) passed when running local Lighthouse against protected staging sites.
responseFormatNomarkdown is concise and readable; json is machine-readable and is also available as structuredContent.markdown

Output Schema

NameRequiredDescriptionDefault
toolYes
resultYes
truncatedNo
truncationMessageNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv2.5.0
    • addedInput schema / properties / engine
      Added value: +{
      +  "description": "Analysis engine: auto (default, uses local Lighthouse for localhost/private URLs and Google PSI for public URLs), psi, or local.",
      +  "enum": [
      +    "auto",
      +    "psi",
      +    "local"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / extraHeaders
      Added value: +{
      +  "additionalProperties": {
      +    "type": "string"
      +  },
      +  "description": "Optional HTTP headers (for example Authorization or Cookie) passed when running local Lighthouse against protected staging sites.",
      +  "type": "object"
      +}
    • changedInput schema / properties / url / description
      Previous value: -"Public http(s) URL, for example https://example.com/products."New value: +"Public or local http(s) URL, for example https://example.com/products or http://localhost:3000."
  2. Addedv2.0.0

TDQS

A4.7/5.0
Behavior4/5

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

Annotations already declare readOnly/openWorld/idempotent/non-destructive, so the safety profile is covered. The description adds real behavioral context beyond them: one lens per call (no combined views) and that focus=visual yields native image screenshots. It doesn't cover engine fallback behavior or latency, which is a reasonable omission given the schema documents engine.

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?

Four short sentences: purpose and lens constraint first, then placement relative to the sibling, then an example, then return guidance. No filler and nothing buried.

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?

With an output schema present and full schema coverage on six parameters, the description only needs to cover purpose, selection, and the one-per-call constraint — all of which it does. No material gap remains for an agent to 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 coverage is 100%, so the baseline is 3, but the description adds meaning not in the enum: 'exactly one' clarifies lenses cannot be combined, and the render-blocking example explains what that value actually diagnoses. Other parameters (engine, strategy, extraHeaders) are left entirely to the schema.

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 ('Inspect') and resource ('one page') plus the key constraint: exactly one diagnostic lens from a fixed set. It explicitly distinguishes itself from the sibling pagespeed_analyze_page by ruling out the general-score use case.

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?

Gives both a positive trigger ('Use after pagespeed_analyze_page identifies a problem') and a negative one ('do not use it for a general score'), naming the alternative. It further illustrates selection with a concrete focus=render-blocking example.

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