Skip to main content
Glama

scrapewise_run_reapply_rules

        Starts a background job that re-runs the scraper's CURRENT post-scrape rules (its own rules, then its
        group's rules, plus constant columns) on every stored row of one finished run and writes the results
        back. It ADDS new rule columns and UPDATES values of rule columns. It never removes a column or a value:
        a rule that was deleted, or that now gives nothing for a row, leaves the old value in place (counted as
        keptStale). Scraped (raw) columns and currency-conversion outputs are never changed. Free (no credits),
        nothing is re-scraped, matching is not started (it reads the new values on its next run).

        Args:
          - jobId (string, path, required): the run's id (scraperJobStatusId).
          - expectedRulesHash (string, query, optional): the rulesHash from the preview; refused with 409 when
            the rules changed since.
          - idempotency_key (string, query): REQUIRED for AI-agent keys. A new value per new start.

        Returns:
          202 with the job (reapplyId, state PENDING, rowsTotal). Poll scrapewise_get_reapply_rules.

        Examples:
          - Use when: "apply my new cleaning rules to run {jobId}" → preview first, then run with its rulesHash.
          - Don't use when: you want fresh data from the website → run the scraper instead.

        Error Handling:
          - 400 (CustomerError): unknown run, no data, no rules to apply, more rows than the limit.
          - 409: the run is not finished, the rules changed since the preview, or a re-apply of this run is
            already active (the body is that job).
          - 429: too many re-apply jobs waiting or running for this customer.
          - 503: switched off by an administrator.
          - 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": {
      "jobId": "<jobId>"
    },
    "name": "scrapewise_run_reapply_rules"
  }
}

Input Schema

NameRequiredDescriptionDefault
jobIdYesthe run's id (scraperJobStatusId).
idempotency_keyNoRequired for AI-agent keys: a new value per new start, the same value only to retry it.
expectedRulesHashNothe rulesHash from the preview; refused with 409 when the rules changed since.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedInput schema / properties / expectedRulesHash / description
      Added value: +"the rulesHash from the preview; refused with 409 when the rules changed since."
    • addedInput schema / properties / jobId / description
      Added value: +"the run's id (scraperJobStatusId)."
  2. Added

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=false and destructiveHint=false; the description corroborates the non-destructive claim with real detail — it ADDS rule columns and UPDATES values but never removes a column or value, leaving stale values counted as keptStale, and raw/currency columns are untouched. It also discloses that the job is free, no re-scraping occurs, matching is not started, and lists status codes 400/409/429/503 with their conditions. Slight deduction because the polling cadence is only implied by naming the get tool.

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?

Front-loaded with the core behavior, then cleanly sectioned into Args, Returns, Examples, and Error Handling. It is long, and the Args block duplicates the fully-documented schema, but nearly every sentence carries operational value.

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?

For a mutation tool with no output schema, it supplies the 202 response shape (reapplyId, state PENDING, rowsTotal), the required follow-up tool to poll, the full error taxonomy, and a runtime hint warning that the response is a dynamic blob to be parsed defensively. An agent has everything needed to call it and handle the result.

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 the baseline is 3. The description's Args section largely restates the schema text (jobId as scraperJobStatusId, expectedRulesHash 409 refusal, idempotency_key required for AI-agent keys), adding only the framing that a new idempotency value is needed per new start, which the schema also states.

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?

States a specific verb and resource: a background job re-running the scraper's current post-scrape rules on every stored row of one finished run, writing results back. It explicitly scopes itself against the sibling preview tool and against running the scraper for fresh data, so an agent can tell it apart from scrapewise_preview_reapply_rules and scrapewise_run_scraper without opening a schema.

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 an explicit 'Use when' example with the correct two-step workflow (preview first, then run with its rulesHash) and a 'Don't use when' exclusion pointing at the scraper run tool. Nothing about when to select this tool is left to inference.

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.