clear_snapshot
Remove cached browser snapshots to resolve stale data issues in Firefox automation workflows.
Instructions
Clear snapshot cache. Usually not needed.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/snapshot.ts:164-175 (handler)Primary MCP tool handler for 'clear_snapshot'. Acquires Firefox instance via getFirefox and calls its clearSnapshot method, returning a success response.export async function handleClearSnapshot(_args: unknown): Promise<McpToolResponse> { try { const { getFirefox } = await import('../index.js'); const firefox = await getFirefox(); firefox.clearSnapshot(); return successResponse('🧹 Snapshot cleared'); } catch (error) { return errorResponse(error as Error); } }
- src/tools/snapshot.ts:52-59 (schema)Tool schema definition including name 'clear_snapshot', description, and empty input schema.export const clearSnapshotTool = { name: 'clear_snapshot', description: 'Clear snapshot cache. Usually not needed.', inputSchema: { type: 'object', properties: {}, }, };
- src/index.ts:128-128 (registration)Registration of the clear_snapshot tool handler in the central toolHandlers Map.['clear_snapshot', tools.handleClearSnapshot],
- src/index.ts:172-172 (registration)Inclusion of clearSnapshotTool in the allTools array for MCP tool listing.tools.clearSnapshotTool,
- src/firefox/index.ts:339-344 (helper)FirefoxClient.clearSnapshot() method invoked by the tool handler, which delegates to the SnapshotManager.clear().clearSnapshot(): void { if (!this.snapshot) { throw new Error('Not connected'); } this.snapshot.clear(); }