A selector that matches nothing produces "" or [], and the job still reports status: "completed", success_count: 1, failed_count: 0. Emptiness is never reported as failure. Measured on a retail site: a scrape returned zero product rows and reported complete success, and the caller only caught it eight tool calls later.
The MCP server therefore reconstructs the absence from the payload and appends a diagnostics block to every scrape_unblocker, check_job and run_routine result that carries result rows.
The block
"diagnostics": {
"rows": 2,
"fields": 4,
"per_row": [
{
"row": 0,
"empty_fields": ["old_price"],
"array_lengths": { "name": 24, "price": 24, "old_price": 0, "link": 24 },
"aligned": false
},
{
"row": 1,
"empty_fields": ["old_price"],
"array_lengths": { "name": 24, "price": 21, "old_price": 0, "link": 24 },
"aligned": false
}
],
"empty_in_all_rows": ["old_price"],
"warnings": [
"These fields were empty on every URL: old_price. Other fields did fill, so the fetch and the selector syntax are fine — these specific selectors matched nothing. …",
"Array fields have DIFFERENT lengths (row 0: name=24, price=24, old_price=0, link=24). The engine does not pad a missing value with a placeholder, so the lists are NOT positionally aligned …",
"Multiple URLs were scraped and the result rows carry no URL of their own — their order does not reliably follow the order of `urls`. Identify each row by its content, not by its position."
]
}Fields
rows— result rows found.fields— distinct field names across rows.per_row[].empty_fields— fields that came back"",[]ornullin that row.per_row[].array_lengths— length of every array field in that row.per_row[].aligned— whether every array field in the row has the same length.nullwhen there are fewer than two arrays to compare.empty_in_all_rows— fields empty in every row: the strongest signal of a bad selector.warnings— plain-language explanations with the likely cause and the fix.
The warnings and what to do
- Every field empty on every URL. That is what a completely non-matching selector set looks like, not an empty page. Two causes dominate: the selector syntax does not match the response type (CSS against JSON), or the selectors were written against a different document than the engine fetched. Confirm with a selector you know exists, such as
title. - Some fields empty on every URL. The fetch and syntax are fine; those specific selectors matched nothing. Re-check them against the document the engine actually received.
- Array fields have different lengths. The lists are not positionally aligned; index i of one is not the same record as index i of another. Treat any record assembled from them as unreliable until the lengths match. Usually a field missing on some records; use
OBJECTwithchildrenon HTML, or a path that always resolves on JSON. - Multiple URLs, rows carry no URL. Add a
URLselector to tag each row, and identify rows by content rather than position.
The rule
Believe diagnostics over status. Never treat markup seen in get_html as proof a selector will match; the two tools fetch through separate services and can be served different documents for the same URL. The only proof a selector works is a real scrape whose diagnostics are clean.
Empty rate as a load signal
On a long run, the share of empty rows in diagnostics is also the only backpressure signal you get. Overload does not come back as errors. If the empty rate climbs after you raise concurrency, halve it and re-check. See Concurrency.
When a payload has no result rows, such as an asynchronous submit that only returns a dispatch_id, no diagnostics block is added. There is nothing to diagnose yet; collect the results with check_job and read the block there.