Skip to main content
Glama

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

NameRequiredDescriptionDefault
idYesthe scraper's MongoDB ObjectId.
withDataNosame semantics as `scrapewise_delete_scraper.withData` — included so the preview's hash covers the destructive-args shape.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedInput schema / properties / id / description
      Added value: +"the scraper's MongoDB ObjectId."
    • addedInput schema / properties / withData / description
      Added value: +"same semantics as `scrapewise_delete_scraper.withData` — included so the preview's hash covers the destructive-args shape."
  2. Added

TDQS

A4.4/5.0
Behavior4/5

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

Goes well beyond the annotations: token TTL and one-time nature, the divergence detector error codes (`SCHEMA_SNAPSHOT_MISMATCH` / `CASCADE_COUNT_DRIFT`), the guarantee that no data is changed, and per-status error handling (400/401/500). Minor gap: it doesn't say whether re-previewing invalidates the prior token beyond noting the old one 'stays valid until TTL expires' — that is actually covered, but token-per-session accumulation is only implied.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Well-structured with labeled Args/Returns/Examples/Error Handling sections and the protocol rationale front-loaded. It is on the long side and duplicates the withData explanation between the prose and the Args block, but for a security-relevant two-call protocol the length is largely earned.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

No output schema exists and the runtime hint warns the response is a dynamic blob, yet the description enumerates the return shape (`token`, `opName`, `targetEntityId`, `previewSummary`) and warns about the TTL. Combined with error handling and the commit handoff, an agent has everything needed to drive the flow correctly.

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 coverage is 100%, so both parameters are already documented and the description's Args block largely restates the schema text verbatim (including the identical withData sentence). It does add a small amount of meaning by noting that withData=true causes the `warnings` array to surface irreversible-data-loss messaging, which is the one genuine value-add over the schema.

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

Purpose5/5

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

Opens with a specific verb and resource plus its role: the preview half of a two-call delete protocol, computing an identity hash, cascade counts, and a 5-min token. It explicitly separates itself from `scrapewise_delete_scraper` (the commit) and `scrapewise_get_scraper` (read-only metadata), so an agent can pick it out of a large sibling set without opening schemas.

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

Usage Guidelines5/5

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

Provides explicit 'Use when' and 'Don't use when' cases, names the alternative for each (get_scraper for metadata, reusing an existing token instead of re-previewing), and states the precondition that commit requires explicit user approval. The withData=true trigger condition is also spelled out.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.