Skip to main content
Glama

smart_diff

Compare before-and-after page states using pixel and DOM analysis to identify moved, resized, or restyled elements, then save baselines and run comparisons by viewport.

Instructions

Compare before/after with both pixel diff AND DOM analysis. Returns structured changes: which elements moved, resized, changed styles. Much more useful than pixel_diff alone. First call with action 'save_baseline', then make changes, then call with action 'compare'.

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": {
      "action": "<action>"
    },
    "name": "smart_diff"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlNoPage URL. Auto-detected if omitted.
nameNoBaseline name. Default: auto-generated.
actionYessave_baseline to save current state, compare to diff against saved baseline.
selectorNoCSS selector to scope diff to a section.
viewportNoViewport. Default: desktop.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.9/5.0
Behavior3/5

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

With no annotations, the description carries the full behavioral burden, and it does disclose the return shape ('which elements moved, resized, changed styles'), which is genuinely useful. However, it says nothing about persistence of baselines (where they are stored, whether save_baseline overwrites an existing baseline of the same name, lifetime of saved state) or about cost/latency of the DOM analysis pass. Those omissions matter for a stateful two-phase tool.

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-loads the core capability and the return shape before the workflow instruction, with no filler paragraphs. The clause 'Much more useful than pixel_diff alone' restates the earlier 'AND DOM analysis' point, a small redundancy that costs a full 5.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a five-parameter, annotation-free tool with no output schema, the description covers what it returns and how to sequence calls, which is most of what an agent needs. Gaps remain around baseline storage/overwrite semantics and whether a stored baseline is shared across sessions or URLs.

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 five parameters, including the action enum and viewport enum, are already documented. The description reinforces the action lifecycle but adds no new meaning for url, name, selector, or viewport beyond the schema text, so the baseline of 3 applies.

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 ('Compare before/after') and adds the distinguishing capability ('both pixel diff AND DOM analysis'). It explicitly names the sibling tool pixel_diff and tells the agent how it differs, so the tool is separable without opening either schema.

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?

Gives an explicit ordered workflow: save_baseline first, make changes, then compare, and names pixel_diff as the narrower alternative. It lacks an explicit 'when not to use' condition (e.g., when only pixels or only DOM matter), which keeps it from a 5.

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