feat: opt-in field filtering for scrape_batch and search_engine_batch by SuarezPM · Pull Request #143 · brightdata/brightdata-mcp · GitHub
Skip to content

feat: opt-in field filtering for scrape_batch and search_engine_batch - #143

Open
SuarezPM wants to merge 1 commit into
brightdata:mainfrom
SuarezPM:feat/batch-field-filtering
Open

SuarezPM wants to merge 1 commit into
brightdata:mainfrom
SuarezPM:feat/batch-field-filtering

Conversation

@SuarezPM

@SuarezPM SuarezPM commented Jun 3, 2026

Copy link
Copy Markdown

Splitting the field-filtering part out of #140 into its own PR.

Adds an optional fields param to both batch tools so you only get back the
fields you actually need — saves a lot of tokens in agent pipelines.
filter_fields skips prototype-polluting keys and has unit tests.

  • Backward compatible: if fields isn't passed, the output is exactly the
    same as before.
  • scrape_batch also isolates errors per URL now (a failed URL comes back as
    {url, error} instead of breaking the settlement) and keeps
    responseType: 'text'.

Leaving the dedup out of this one — it needs a block-level rewrite to actually
collapse shared boilerplate properly, so that'll come as its own PR.

Optional `fields` param returns only the requested top-level fields, to save
tokens in agent pipelines. Backward compatible: when omitted, output is
unchanged. scrape_batch also isolates per-URL errors (a failed URL resolves
to {url, error} instead of a rejected settlement).
@egoriklok

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants