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
| Name | Required | Description | Default |
|---|---|---|---|
| selector | No | CSS selector to scope the snapshot | |
| interactive_only | No | Only show interactive elements |
Implementation Reference
- src/tools/snapshot-tools.ts:49-62 (handler)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 }; } } - src/tools/snapshot-tools.ts:42-48 (registration)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'), },