Skip to main content
Glama

scrapewise_run_scraper_data_group

Destructive
        Combines the scraped rows from N scraperJobStatus runs (each from a different
        scraper) into one enriched dataset, matched on the `title` field (which must
        be a stable identifier like EAN/barcode — NOT a constant). The result lands in
        the group's enriched-sibling collection (same `reference` UUID, group name +
        "_enriched"). Requires the DATA_ENRICHMENT plan feature. Only the LATEST
        completed run per scraper is accepted. It REPLACES the group's existing
        enriched dataset: call scrapewise_get_enrichment first and confirm with the user
        before you overwrite one. The group must be your own.

        Args:
          - id (string, path param, required): the group's MongoDB ObjectId.
          - scraperJobStatusIds (Set<string>, query param, required): the run ids to
            merge. Pass each via repeated query param: ?scraperJobStatusIds=a&scraperJobStatusIds=b.

        Returns:
          `Map<String, Any>` — currently `{"mergedItems": <int>}` indicating how many
          enriched rows were produced.

        Examples:
          - Use when: "merge runs {a, b, c} of group {id} into one dataset by EAN"
          - Use when: "combine results from these scraper runs into the enriched
            sibling collection" → same op
          - Use when: "consolidate the latest runs of competitor scrapers A and B"
          - Don't use when: scrapers don't share a stable id field → won't match anything
            and the call returns 422 (no rows merged)

        Error Handling:
          - 402 if customer plan lacks DATA_ENRICHMENT feature.
          - 422 if zero rows could be merged (none of the supplied runs are the LATEST
            COMPLETED for their scraper, or the rows have no matching `title` field).
          - 400 (CustomerError envelope) if no group with the given id exists for this
            customer, scraperJobStatusIds is empty, or an id is not a valid ObjectId.
          - 500 INTERNAL on an unexpected error.
          - 401 Unauthorized.

[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_run_scraper_data_group"
  }
}

Input Schema

NameRequiredDescriptionDefault
idYesthe group's MongoDB ObjectId.
bodyNoOptional column-mapping spec: with it, the runs are joined by these column mappings. Without a body, the runs in scraperJobStatusIds are joined by product title (the older way).
scraperJobStatusIdsNothe run ids to merge. Pass each via repeated query param: ?scraperJobStatusIds=a&scraperJobStatusIds=b.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • addedInput schema / properties / body / description
      Added value: +"Optional column-mapping spec: with it, the runs are joined by these column mappings. Without a body, the runs in scraperJobStatusIds are joined by product title (the older way)."
    • addedInput schema / properties / id / description
      Added value: +"the group's MongoDB ObjectId."
    • addedInput schema / properties / scraperJobStatusIds / description
      Added value: +"the run ids to merge. Pass each via repeated query param: ?scraperJobStatusIds=a&scraperJobStatusIds=b."
  2. Added

TDQS

A4.5/5.0
Behavior5/5

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

Annotations already flag destructiveHint=true and idempotentHint=false, but the description goes well beyond that: it discloses the DATA_ENRICHMENT plan gate, the LATEST-completed-run-only constraint, that the existing enriched dataset is REPLACED, ownership requirement ('the group must be your own'), and a full error taxonomy (402/422/400/500/401) with the conditions that trigger each.

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 operation and the destructive-overwrite warning before the mechanical Args/Returns/Examples/Error sections. The structured sections are easy to scan, though the Examples and Error Handling blocks are somewhat verbose and the Args section largely duplicates the schema descriptions.

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

Completeness4/5

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

For a destructive, nested-parameter tool with no output schema, the description supplies the return shape (`{"mergedItems": <int>}`), all failure modes, and the confirmation workflow, which is near-complete. The one real gap is that the optional column-mapping `body` and its matchMode/collisions semantics are never described in prose, leaving only the schema to explain the alternative join path.

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 description coverage is 100%, so the baseline is 3. The description restates `id` as the group's MongoDB ObjectId and repeats the repeated-query-param syntax already present in the schema, and it adds the useful constraint that only the latest completed runs are accepted. However it mentions only title-based matching and never explains the optional `body` column-mapping spec (edges/nodes/collisions/primaryScraperId), the most complex parameter in 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?

States a specific verb and outcome: combines scraped rows from N scraperJobStatus runs, each from a different scraper, into one enriched dataset in the group's '_enriched' sibling collection. It also names the matching key (`title` must be a stable identifier) and the plan prerequisite, so the agent knows exactly what operation is being performed and how it differs from the read-only get_enrichment sibling.

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 both positive triggers (merge runs {a,b,c} of a group, combine results into the enriched sibling collection, consolidate latest competitor runs) and an explicit negative case (scrapers without a shared stable id field in the 422 path). It also mandates a precondition workflow: call scrapewise_get_enrichment first and confirm with the user before overwriting.

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.