Skip to main content
Glama

Optimize the images on a website

optimize_website

Start at one public web page, follow its links to the other pages on the same host, find every image they reference (img, srcset, picture, lazy-load attributes, inline CSS backgrounds, social images, icons), convert them to WebP and return a report: the pages scanned, each image's size before and after and the pages that use it, a download URL per image, zip_url for everything, and replacements mapping each original URL to its new file. To apply it to a codebase: download and unpack the ZIP, put the files from images/ next to the originals, then change each reference per replacements (or wrap it in a element with the WebP as and the original as the fallback). The free plan scans up to 5 pages and 100 images per call, Pro up to 50 pages and 500 images. A large site can take minutes: if the result is not ready the call returns a job_id to pass to get_website_report.

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

Input Schema

NameRequiredDescriptionDefault
urlYesAddress to start from, e.g. https://example.com
qualityNoWebP quality, default 80.
max_pagesNoScan at most this many pages. Default: the plan's limit. Use 1 for a single page.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior5/5

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

Annotations only declare readOnly=false, openWorld=true, idempotent=false, destructive=false; the description goes well beyond them by disclosing plan-based rate/scope limits (5 pages/100 images free, 50/500 Pro), long-running behavior with a job_id fallback, and the full return shape including zip_url and replacements. Nothing here contradicts the annotations — the tool produces artifacts rather than mutating the target site, consistent with destructiveHint=false.

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?

Front-loaded with the action and output, then the codebase application steps, then limits and async behavior — a sensible ordering. It is dense and the download/unpack/<picture> instructions are somewhat verbose, but each sentence carries operational information.

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 no output schema, the description fully compensates by enumerating the report contents (pages scanned, before/after sizes, usage pages, per-image download URL, zip_url, replacements) and explaining the async continuation path. An agent has everything needed to invoke it and consume the result.

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 coverage is 100%, so all three parameters are already documented, and the description adds only indirect meaning: the plan caps explain the effective ceiling and default for max_pages. The quality parameter is never mentioned, so the description does not extend parameter understanding much beyond 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 and resource chain: crawl a starting URL, follow same-host links, discover every image reference type (img, srcset, picture, lazy-load, CSS backgrounds, social images, icons), convert to WebP, and return a report. That is far more specific than the title and distinguishes it from single-asset siblings like convert_image or compress_image.

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?

Usage context is clear (site-wide image optimization rather than one image) and it names the follow-up tool get_website_report with the exact condition that selects it ('if the result is not ready... job_id'). It does not explicitly exclude or route away from siblings such as list_website_assets, list_website_pages, or get_website_scan, which an agent may confuse with the crawl/discovery phase.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources