Skip to main content
Glama

Compare replica against original

compare_replica
Read-onlyIdempotent

Verify a replica against the original by running a deterministic perceptual diff, then attribute the worst visual mismatches to specific elements and styles for actionable evidence.

Instructions

Use this when a replica exists and you need evidence-driven visual verification or a same-page noise-floor check. Avoid it when you have not implemented a replica yet. Run a deterministic perceptual diff and attribute the worst visual mismatches to elements and styles. Cost: heavy. Session: loads the original and comparison target. Does not write files. Possible follow-ups if evidence is still missing: inspect_component.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fullPageNoCompare the full page instead of only the viewport.
selfCheckNoCompare the original with a second fresh load of itself; cannot be combined with a replica source.
thresholdNoDifference threshold. YIQ mode normalizes this legacy 0–765 scale.
timeoutMsNoNavigation timeout in milliseconds.
userAgentNoOptional browser user-agent override.
waitUntilNoPage lifecycle event to await before extraction.domcontentloaded
autoScrollNoScroll through the page before extraction to trigger lazy-rendered content.
maxScrollsNoMaximum viewport-sized scroll steps when autoScroll is enabled.
replicaUrlNoURL of the replica. Provide this or replicaPath.
colorMetricNoPerceptual YIQ by default; rgbSum exactly reproduces the v0.9 metric.yiq
maxHeightPxNoCap on the compared page height.
originalUrlYesAbsolute http:// or https:// URL of the original website.
replicaPathNoAbsolute path to a local replica HTML file. Provide this or replicaUrl.
alignSectionsNoWhen page heights diverge, also compare paired top-level sections.
viewportWidthNoBrowser viewport width in CSS pixels.
viewportHeightNoBrowser viewport height in CSS pixels.
attributeRegionsNoAttribute worst regions to elements on both pages and report computed-style deltas.
ignoreAntialiasingNoExclude detected anti-aliased edge pixels from mismatch counts.
allowPrivateNetworkNoAllow localhost and private-network URLs. Enable only for trusted sites.
allowPrivateReplicaNoAllow localhost/private replica URLs.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYesVisual metrics; the diff is returned as MCP image content.
guidanceYes

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Changed7 schema fields changedv0.10.1
    • addedOutput schema / properties / guidance
      Added value: +{
      +  "additionalProperties": false,
      +  "properties": {
      +    "cost": {
      +      "enum": [
      +        "light",
      +        "standard",
      +        "heavy"
      +      ],
      +      "type": "string"
      +    },
      +    "nextTools": {
      +      "description": "Candidate follow-ups; do not call them automatically or in parallel.",
      +      "items": {
      +        "enum": [
      +          "analyze_site",
      +          "analyze_html",
      +          "inspect_component",
      +          "capture_screenshot",
      +          "extract_assets",
      +          "extract_animations",
      +          "extract_layout",
      +          "clone_section",
      +          "capture_interactions",
      +          "extract_responsive",
      +          "compare_replica",
      +          "create_replication_kit",
      +          "capture_motion",
      +          "crawl_site"
      +        ],
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "sessionPolicy": {
      +      "enum": [
      +        "offline-document",
      +        "single-url",
      +        "multi-viewport",
      +        "dual-page",
      +        "site-crawl"
      +      ],
      +      "type": "string"
      +    },
      +    "summary": {
      +      "minLength": 1,
      +      "type": "string"
      +    },
      +    "tool": {
      +      "const": "compare_replica",
      +      "type": "string"
      +    },
      +    "warnings": {
      +      "description": "Non-fatal limitations or incomplete evidence from this run.",
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "writesFiles": {
      +      "type": "boolean"
      +    }
      +  },
      +  "required": [
      +    "tool",
      +    "summary",
      +    "nextTools",
      +    "warnings",
      +    "cost",
      +    "writesFiles",
      +    "sessionPolicy"
      +  ],
      +  "type": "object"
      +}
    • addedOutput schema / properties / result / additionalProperties
      Added value: +{}
    • addedOutput schema / properties / result / description
      Added value: +"Visual metrics; the diff is returned as MCP image content."
    • addedOutput schema / properties / result / properties
      Added value: +{
      +  "aaPixels": {
      +    "maximum": 9007199254740991,
      +    "minimum": 0,
      +    "type": "integer"
      +  },
      +  "compared": {
      +    "additionalProperties": {},
      +    "properties": {},
      +    "type": "object"
      +  },
      +  "determinismCheck": {
      +    "additionalProperties": {},
      +    "properties": {},
      +    "type": "object"
      +  },
      +  "matchPercent": {
      +    "type": "number"
      +  },
      +  "metadata": {
      +    "additionalProperties": {},
      +    "properties": {},
      +    "type": "object"
      +  },
      +  "mismatchedPixels": {
      +    "maximum": 9007199254740991,
      +    "minimum": 0,
      +    "type": "integer"
      +  },
      +  "original": {
      +    "additionalProperties": {},
      +    "properties": {},
      +    "type": "object"
      +  },
      +  "replica": {
      +    "additionalProperties": {},
      +    "properties": {},
      +    "type": "object"
      +  },
      +  "sections": {
      +    "items": {
      +      "additionalProperties": {},
      +      "properties": {},
      +      "type": "object"
      +    },
      +    "type": "array"
      +  },
      +  "totalPixels": {
      +    "maximum": 9007199254740991,
      +    "minimum": 0,
      +    "type": "integer"
      +  },
      +  "viewport": {
      +    "additionalProperties": {},
      +    "properties": {},
      +    "type": "object"
      +  },
      +  "warnings": {
      +    "description": "Non-fatal limitations or incomplete evidence from this run.",
      +    "items": {
      +      "type": "string"
      +    },
      +    "type": "array"
      +  },
      +  "worstRegions": {
      +    "items": {
      +      "additionalProperties": {},
      +      "properties": {},
      +      "type": "object"
      +    },
      +    "type": "array"
      +  }
      +}
    • addedOutput schema / properties / result / required
      Added value: +[
      +  "metadata",
      +  "viewport",
      +  "original",
      +  "replica",
      +  "compared",
      +  "matchPercent",
      +  "mismatchedPixels",
      +  "totalPixels",
      +  "worstRegions",
      +  "warnings"
      +]
    • addedOutput schema / properties / result / type
      Added value: +"object"
    • changedOutput schema / required
      Previous value: -[
      -  "result"
      -]New value: +[
      +  "result",
      +  "guidance"
      +]
  2. Changed8 schema fields changedv0.10.0
    • addedInput schema / properties / alignSections
      Added value: +{
      +  "default": false,
      +  "description": "When page heights diverge, also compare paired top-level sections.",
      +  "type": "boolean"
      +}
    • changedInput schema / properties / allowPrivateReplica / description
      Previous value: -"Allow localhost/private replica URLs (the usual case for a dev server)."New value: +"Allow localhost/private replica URLs."
    • addedInput schema / properties / attributeRegions
      Added value: +{
      +  "default": true,
      +  "description": "Attribute worst regions to elements on both pages and report computed-style deltas.",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / colorMetric
      Added value: +{
      +  "default": "yiq",
      +  "description": "Perceptual YIQ by default; rgbSum exactly reproduces the v0.9 metric.",
      +  "enum": [
      +    "rgbSum",
      +    "yiq"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / ignoreAntialiasing
      Added value: +{
      +  "default": true,
      +  "description": "Exclude detected anti-aliased edge pixels from mismatch counts.",
      +  "type": "boolean"
      +}
    • changedInput schema / properties / replicaUrl / description
      Previous value: -"URL of the replica, e.g. http://localhost:5173. Provide this or replicaPath."New value: +"URL of the replica. Provide this or replicaPath."
    • addedInput schema / properties / selfCheck
      Added value: +{
      +  "default": false,
      +  "description": "Compare the original with a second fresh load of itself; cannot be combined with a replica source.",
      +  "type": "boolean"
      +}
    • changedInput schema / properties / threshold / description
      Previous value: -"Per-pixel RGB delta (sum of channel differences) above which a pixel counts as mismatched."New value: +"Difference threshold. YIQ mode normalizes this legacy 0–765 scale."
  3. First observedv0.8.0

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, and destructiveHint=false. The description adds genuinely useful behavioral context beyond those annotations: the operation is heavy, the session loads both the original and the comparison target, it does not write files, and it performs deterministic perceptual diffing. No contradiction with annotations.

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?

The description is compact and front-loaded: usage conditions first, then behavior, then cost/session side effects, then follow-up guidance. Every sentence earns its place with no redundancy or filler.

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?

Despite high complexity—20 parameters and an output schema—the description covers the essential context an agent needs: when to call it, what it does, its cost, side effects, and a fallback tool. Since an output schema exists, the description does not need to explain return values. No critical gaps remain.

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 the input schema already documents all 20 parameters with meaningful descriptions. The tool description adds high-level framing, such as perceptual diffing and worst-mismatch attribution, but does not need to repeat parameter-level detail. Baseline 3 is appropriate.

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 clearly states a specific verb and resource: compare a replica against an original via a deterministic perceptual diff and attribute visual mismatches. It also names the same-page noise-floor self-check mode, which distinguishes this tool from any sibling that merely captures or inspects a page.

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?

Explicitly says when to use it ('when a replica exists and you need evidence-driven visual verification or a same-page noise-floor check') and when to avoid it ('Avoid it when you have not implemented a replica yet'). It also suggests a follow-up tool, inspect_component, when evidence is still missing.

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

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/blackridder22/PicassoWeb'

If you have feedback or need assistance with the MCP directory API, please join our Discord server