archive_org_snapshot
Check Wayback Machine snapshots for archived web content to verify historical page versions and track changes over time.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | URL to check for Wayback Machine snapshots |
Implementation Reference
- src/tools/archive.ts:12-35 (handler)Implementation of the logic to fetch the latest archive.org snapshot.
async getLatestSnapshot(url: string): Promise<any> { try { const data = await this.fetch<any>("", { method: "GET", }, { url: url, }); const snapshot = data.archived_snapshots?.closest; if (!snapshot || !snapshot.available) { return { available: false, message: "No snapshots found for this URL" }; } return { available: true, url: snapshot.url, timestamp: snapshot.timestamp, status: snapshot.status }; } catch (error) { if (error instanceof McpError) throw error; throw new McpError(ErrorCode.InternalError, `Wayback Machine error: ${(error as Error).message}`); } } - src/index.ts:439-448 (registration)Registration of the archive_org_snapshot tool and the handler wrapper.
server.tool( "archive_org_snapshot", { url: z.string().url().describe("URL to check for Wayback Machine snapshots") }, async ({ url }) => { const result = await archiveClient.getLatestSnapshot(url); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }], }; } );