Skip to main content
Glama

pilot_snapshot_diff

Compare current page state against previous snapshots to identify changes. First call establishes baseline, subsequent calls generate unified diffs showing modifications.

Instructions

Compare current page state against the last snapshot. Returns unified diff showing what changed. First call stores baseline.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
selectorNoCSS selector to scope the snapshot
interactive_onlyNoOnly show interactive elements

Implementation Reference

  • The handler implementation for the 'pilot_snapshot_diff' tool, which uses 'diffSnapshot' to compare the current browser state to a baseline.
    async ({ selector, interactive_only }) => {
      await bm.ensureBrowser();
      try {
        const result = await diffSnapshot(bm, {
          selector,
          interactive: interactive_only,
        });
        bm.resetFailures();
        return { content: [{ type: 'text' as const, text: result }] };
      } catch (err) {
        bm.incrementFailures();
        return { content: [{ type: 'text' as const, text: wrapError(err) }], isError: true };
      }
    }
  • Tool registration for 'pilot_snapshot_diff' in src/tools/snapshot-tools.ts.
    server.tool(
      'pilot_snapshot_diff',
      'Compare current page state against the last snapshot. Returns unified diff showing what changed. First call stores baseline.',
      {
        selector: z.string().optional().describe('CSS selector to scope the snapshot'),
        interactive_only: z.boolean().optional().describe('Only show interactive elements'),
      },
Behavior4/5

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

With no annotations provided, the description carries the full disclosure burden. It successfully reveals the stateful behavior (first call stores baseline), output format (unified diff), and comparison logic. It could improve by mentioning snapshot persistence scope or whether the comparison is DOM-deep vs visual.

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 consists of three efficient sentences with zero redundancy. It front-loads the primary action (Compare current page state) and follows with output format and initialization behavior. Every sentence earns its place; no restructuring needed.

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?

Given the tool's stateful complexity and lack of annotations, the description adequately covers the critical behavioral quirks (baseline storage on first call) and mentions the return value. It lacks differentiation from pilot_page_diff, preventing a 5, but provides sufficient context for invocation.

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%, meaning the schema fully documents both parameters (selector and interactive_only). The description adds no additional parameter semantics beyond what the JSON schema provides, which is appropriate baseline scoring for high-coverage schemas.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the core action (comparing page state against a snapshot) and output format (unified diff). It distinguishes from pilot_snapshot (which only captures state) via the comparison verb. However, it fails to differentiate from the sibling tool pilot_page_diff, which creates ambiguity.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides implied usage guidance through 'First call stores baseline,' alerting users to the stateful nature of the tool. However, it lacks explicit guidance on when to use this versus pilot_page_diff or pilot_element_state, and doesn't mention prerequisites (like whether a snapshot must exist first).

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

Install Server

Other Tools

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/TacosyHorchata/Pilot'

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