fix: describe every generated web_data_* tool input to the model - #175
Open
karaposu wants to merge 1 commit into
Open
fix: describe every generated web_data_* tool input to the model#175karaposu wants to merge 1 commit into
karaposu wants to merge 1 commit into
Conversation
The 50 generated dataset tools built their input schemas with one rule: url got z.string().url(), everything else a bare z.string() -- no .describe() on anything. A model filling days_limit: string had no way to know whether it wants "7", "7 days", or a date; whether num_of_reviews accepts "all"; or that days_back's default "" means "no time filter". The result was a standing tax of hallucinated arguments across two-thirds of the tool surface, while the hand-written tools in the same file are richly described. A census over the table shows 50 datasets share just 12 distinct input names (url x45, prompt x3, package_name x2, and nine singles), so a 12-entry name-keyed map in dataset_inputs.js (shipped via files[]) covers the whole surface; the generation loop attaches .describe() when an entry exists. Types, defaults, fixed_values, and the datasets table itself are untouched -- values travel to the trigger endpoint as strings (the table's own defaults are "3", "10", ""; Bright Data's CLI passes the same fields as strings), so numeric inputs are described "as a numeric string" and the empty-string defaults are explained rather than retyped. Description semantics were checked against Bright Data's own data-feeds skill and CLI source (keyword + domain URL for amazon_product_search, first/last name for linkedin_people_search, days_limit as a days window, num_of_comments count); the two date fields use example phrasing (e.g., "2025-01-31") rather than asserting an unverified format. No wire change: strictly additive schema metadata. Merge note: brightdata#163's f62a091 edits the poll section of the same generated execute (logically independent). Adds test/dataset-inputs.test.js: a source-level consistency check (every table input has a map entry, no orphans -- loud when a future dataset adds a new input name), text well-formedness, and a spawn test asserting the descriptions actually surface in MCP tools/list (fails on the pre-fix code, where days_back was exactly {"type":"string","default":""}).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The 50 generated
web_data_*tools build their input schemas with one rule:urlgetsz.string().url(), everything else a barez.string()— no.describe()on anything. A modelfilling
days_limit: stringhas no way to know whether it wants"7","7 days", or a date;whether
num_of_reviewsaccepts"all"; or thatdays_back's default""means "no time filter."The result is a standing tax of hallucinated arguments across two-thirds of the tool surface, while
the hand-written tools in the same file are richly described.
Fix
A census over the table shows the 50 datasets share just 12 distinct input names (
url×45,prompt×3,package_name×2, plus nine singles), so a 12-entry name-keyed map indataset_inputs.js(shipped viafiles[]) covers the whole surface; the generation loop attaches.describe()when an entry exists (3 lines). Types, defaults,fixed_values, and the datasets tableitself are untouched — values travel to the trigger endpoint as strings (the table's own defaults
are
"3","10","", and the Bright Data CLI passes the same fields as strings), so numericinputs are described "as a numeric string" and the empty-string defaults are explained rather than
retyped.
Description semantics were checked against Bright Data's own
data-feedsskill and CLI source(keyword + domain URL for
amazon_product_search, first/last name forlinkedin_people_search,days_limitas a days window, comment/review counts); the two date fields use example phrasing(
e.g., "2025-01-31") rather than asserting an unverified format.Behaviour change
None on the wire — strictly additive schema metadata: the generated tools now publish input
descriptions in
tools/list.Tests
test/dataset-inputs.test.js: a source-level consistency check (every table input has a map entry,no orphans — loud the moment a future dataset adds a new input name), text well-formedness, and a
spawn test asserting the descriptions actually surface over MCP
tools/list(fails on the pre-fixcode, where
days_backwas exactly{"type":"string","default":""}).Notes
#163's
f62a091edits the poll section of the same generatedexecute— logically independent;expect one-line
files[]/import rebases against sibling PRs depending on merge order.