scrapewise_delete_scraper_preview
First half of the destructive-op two-call protocol per ADR-012. Computes the
scraper's identity hash + cascade-row counts, mints a 5-min `DestructiveOpToken`,
and returns it alongside a human-readable preview. The agent surfaces the
preview to the user; once confirmed, the agent calls `scrapewise_delete_scraper`
with the same body + `?token=<token>` query param to perform the actual delete.
The two-call flow prevents AI-agent destructive misfires: between preview and
commit, the user can re-read the impact + abort, AND a divergence detector
(`SCHEMA_SNAPSHOT_MISMATCH` / `CASCADE_COUNT_DRIFT`) refuses the commit if the
scraper changed between preview and confirmation.
Changes none of your data; each call issues a new one-time confirm token.
Args:
- id (string, path param, required): the scraper's MongoDB ObjectId.
- withData (boolean, query param, optional, default false): same semantics as
`scrapewise_delete_scraper.withData` — included so the preview's hash
covers the destructive-args shape.
Returns:
`DestructivePreviewResponseDTO` with `token` (opaque UUID; supply to commit
within 5 min), `opName`, `targetEntityId`, and `previewSummary` (entity name,
entity type, cascade-row counts, warnings).
Examples:
- Use when: agent intends to call `scrapewise_delete_scraper` and wants the
user to confirm the blast radius first — call preview, render the summary
to the human, then only proceed to commit on explicit approval.
- Use when: `withData=true` — the preview's `warnings` array surfaces the
irreversible-data-loss warning the user must see before committing.
- Don't use when: you just want the scraper's metadata → use
`scrapewise_get_scraper` (read-only, no token side-effect).
- Don't use when: you've already previewed in this session → re-use the
existing token within its 5-min TTL; calling preview again mints a new
token and the old one stays valid until TTL expires.
Error Handling:
- 400 (CustomerError envelope) if no scraper with the given id exists for this customer.
- 401 Unauthorized.
- 500 INTERNAL.[runtime hint] This tool returns JSON-as-text — its response shape is dynamic (per-scraper itemsConfig, file binary, etc.) so the MCP outputSchema is omitted. Do not rely on the presence of any specific field in the response; treat the result as a string-or-object blob and parse defensively.
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": {
"id": "<id>"
},
"name": "scrapewise_delete_scraper_preview"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | the scraper's MongoDB ObjectId. | |
| withData | No | same semantics as `scrapewise_delete_scraper.withData` — included so the preview's hash covers the destructive-args shape. |