scrapewise_update_scraper_group_post_process_rules
Replaces the group's shared post-processing rules and per-scraper values in one save
(compare-and-set on version). See scrapewise_get_scraper_group_post_process_rules for how group
rules run. Send an empty rules list to clear them.
Args:
- id (string, path param, required): the group's MongoDB ObjectId.
- body (GroupPostProcessRulesUpdateDTO, required):
- rules: GroupPostProcessRule[] (max 50) — kind, sourceField, outputField, outputType,
params, plus optional conditions [{field, op, value | values}] (max 3; op equals | in |
contains | notBlank | blank), branchSet + branch (a named choice; same conditions on
every rule of one choice, 2-10 choices per set, max 10 sets). overwritesRawField must be
false. CURRENCY_CONVERT: exactly one of params.from (fixed code) or params.fromField (the
column holding the code), plus params.to. Rules of different choices of one choice group
may share an outputField; any other duplicate outputField is a 400. No rule may read a
<to>_rate / <to>_rate_date column. ENUM_MAP: a non-empty mapping, or an empty one with a
default (fixed value).
- scraperValues: {scraperId: {name: value}} — max 5 names, values 1-50 characters. Ids of
this group's scrapers only; a scraper that moved to another group is dropped (warning).
- expectedVersion: the version read with the GET (0 when there are no rules yet).
Returns:
GroupPostProcessRulesDTO (page 0) plus warnings: inputs no scraper declares, condition names
that are both a column and a scraper value, dropped values.
Examples:
- Use when: "convert every scraper's price in group {id} to EUR" -> one CURRENCY_CONVERT rule
price -> price_eur with params {fromField: "currency", to: "EUR"}
- Use when: "per 50 g for yarn, per piece for accessories" -> a choice group with conditions
- Typical price-compare layout: CURRENCY_CONVERT price -> price_eur and sale_price ->
sale_price_eur (fromField: currency); ONE choice group (branchSet) with one choice per
product kind (conditions on a per-scraper value such as product_type), whose choices
share the outputs unit, unit_price, sale_unit_price, unit_price_eur,
sale_unit_price_eur (a fixed `unit` label is an ENUM_MAP with an empty mapping and a
default inside each choice; its sourceField must be a column every row has filled,
such as name — never a scraper value). scraperValues only steer conditions; they are
never written as a column. Read `warnings` in the response after the save.
- Don't use when: you want to change one scraper's own rules -> scrapewise_create_scraper
Error Handling:
- 400 (CustomerError / validation envelope) on any bound or rule error (the message names it),
for another customer's or an unknown scraper id in scraperValues, or if no group with this id
exists for this customer.
- 409 CONFLICT if expectedVersion is not the current version (reload and retry).
- 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>",
"body": "<body>"
},
"name": "scrapewise_update_scraper_group_post_process_rules"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | the group's MongoDB ObjectId. | |
| body | Yes | The group's shared rules and the per-scraper values their conditions may read. |