Skip to content

Commit 5bc2bd6

Browse files
committed
fix(context_dev): validation pass — add search numResults/country, accuracy fixes
Comprehensive /validate-integration of all 22 context.dev tools against the live API docs found the integration clean (no correctness bugs). Applied the actionable items: - search: expose numResults (10-100) + country inputs (API supported them; users were silently capped at 10 results) - accuracy: scrape_html type description (+doc/docx), map meta description (+sitemapsSkipped), brand links description (+contact) - robustness: trim string query values in appendParam
1 parent e7635db commit 5bc2bd6

8 files changed

Lines changed: 57 additions & 11 deletions

File tree

apps/docs/content/docs/en/integrations/context_dev.mdx

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ Scrape any URL and return the raw HTML content of the page.
6565
| --------- | ---- | ----------- |
6666
| `html` | string | Raw HTML content of the page |
6767
| `url` | string | The scraped URL |
68-
| `type` | string | Detected content type \(html, xml, json, text, csv, markdown, svg, pdf\) |
68+
| `type` | string | Detected content type \(html, xml, json, text, csv, markdown, svg, pdf, doc, docx\) |
6969

7070
### `context_dev_scrape_images`
7171

@@ -177,7 +177,7 @@ Build a sitemap of a domain and return every discovered page URL.
177177
| --------- | ---- | ----------- |
178178
| `domain` | string | The domain that was mapped |
179179
| `urls` | array | All page URLs discovered from the sitemap |
180-
| `meta` | object | Sitemap discovery stats \(sitemapsDiscovered, sitemapsFetched, errors\) |
180+
| `meta` | object | Sitemap discovery stats \(sitemapsDiscovered, sitemapsFetched, sitemapsSkipped, errors\) |
181181

182182
### `context_dev_search`
183183

@@ -191,6 +191,8 @@ Search the web with natural language and optionally scrape results to markdown.
191191
| `includeDomains` | array | No | Only return results from these domains |
192192
| `excludeDomains` | array | No | Exclude results from these domains |
193193
| `freshness` | string | No | Recency filter \(last_24_hours, last_week, last_month, last_year\) |
194+
| `numResults` | number | No | Number of results to return \(10-100, default 10\) |
195+
| `country` | string | No | Restrict results to a country \(ISO 3166-1 alpha-2 code, e.g. US\) |
194196
| `queryFanout` | boolean | No | Expand the query into parallel variants for broader coverage |
195197
| `markdownEnabled` | boolean | No | Scrape each result page to markdown \(default: false\) |
196198
| `timeoutMS` | number | No | Request timeout in milliseconds \(1000-300000\) |
@@ -449,7 +451,7 @@ Retrieve brand data for a domain: logos, colors, backdrops, socials, address, an
449451
|`email` | string | Brand contact email |
450452
|`phone` | string | Brand contact phone |
451453
|`industries` | json | Industry taxonomy \(eic industry/subindustry pairs\) |
452-
|`links` | json | Key brand links \(careers, privacy, terms, blog, pricing\) |
454+
|`links` | json | Key brand links \(careers, privacy, terms, blog, pricing, contact\) |
453455
|`primary_language` | string | Primary language of the brand site |
454456

455457
### `context_dev_get_brand_by_name`
@@ -488,7 +490,7 @@ Retrieve brand data by company name: logos, colors, socials, address, and indust
488490
|`email` | string | Brand contact email |
489491
|`phone` | string | Brand contact phone |
490492
|`industries` | json | Industry taxonomy \(eic industry/subindustry pairs\) |
491-
|`links` | json | Key brand links \(careers, privacy, terms, blog, pricing\) |
493+
|`links` | json | Key brand links \(careers, privacy, terms, blog, pricing, contact\) |
492494
|`primary_language` | string | Primary language of the brand site |
493495

494496
### `context_dev_get_brand_by_email`
@@ -526,7 +528,7 @@ Retrieve brand data from a work email address. Free/disposable emails are reject
526528
|`email` | string | Brand contact email |
527529
|`phone` | string | Brand contact phone |
528530
|`industries` | json | Industry taxonomy \(eic industry/subindustry pairs\) |
529-
|`links` | json | Key brand links \(careers, privacy, terms, blog, pricing\) |
531+
|`links` | json | Key brand links \(careers, privacy, terms, blog, pricing, contact\) |
530532
|`primary_language` | string | Primary language of the brand site |
531533

532534
### `context_dev_get_brand_by_ticker`
@@ -565,7 +567,7 @@ Retrieve brand data for a public company by its stock ticker symbol.
565567
|`email` | string | Brand contact email |
566568
|`phone` | string | Brand contact phone |
567569
|`industries` | json | Industry taxonomy \(eic industry/subindustry pairs\) |
568-
|`links` | json | Key brand links \(careers, privacy, terms, blog, pricing\) |
570+
|`links` | json | Key brand links \(careers, privacy, terms, blog, pricing, contact\) |
569571
|`primary_language` | string | Primary language of the brand site |
570572

571573
### `context_dev_get_brand_simplified`
@@ -632,7 +634,7 @@ Identify the brand behind a raw bank/card transaction descriptor and return its
632634
|`email` | string | Brand contact email |
633635
|`phone` | string | Brand contact phone |
634636
|`industries` | json | Industry taxonomy \(eic industry/subindustry pairs\) |
635-
|`links` | json | Key brand links \(careers, privacy, terms, blog, pricing\) |
637+
|`links` | json | Key brand links \(careers, privacy, terms, blog, pricing, contact\) |
636638
|`primary_language` | string | Primary language of the brand site |
637639

638640
### `context_dev_prefetch_domain`

apps/docs/content/docs/en/integrations/slack.mdx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1734,6 +1734,9 @@ Trigger workflow from Slack events like mentions, messages, and reactions
17341734
|`callback_id` | string | Callback ID of the shortcut or view. Present for shortcuts and modal submissions |
17351735
|`api_app_id` | string | Slack app ID. Present for interactivity and slash commands |
17361736
|`message_ts` | string | Timestamp of the message the interaction originated from. Present for block_actions |
1737+
|`view` | json | Full Slack view object for modal interactions: state.values \(submitted input values\), private_metadata, id, callback_id, and hash. Present for view_submission/view_closed; null otherwise |
1738+
|`message` | json | Full source message object the interaction came from, including its blocks and text. Present for block_actions on a message; null otherwise |
1739+
|`state` | json | Current values of all stateful elements in the surface \(state.values\) at the time of a block action — e.g. inputs read on a button click. Present for block_actions; null otherwise |
17371740
|`hasFiles` | boolean | Whether the message has file attachments |
17381741
|`files` | file[] | File attachments downloaded from the message \(if includeFiles is enabled and bot token is provided\) |
17391742

apps/sim/blocks/blocks/context_dev.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,22 @@ Do not include any explanations, markdown formatting, or other text outside the
317317
mode: 'advanced',
318318
condition: { field: 'operation', value: 'search' },
319319
},
320+
{
321+
id: 'numResults',
322+
title: 'Number of Results',
323+
type: 'short-input',
324+
placeholder: '10 to 100 (default 10)',
325+
mode: 'advanced',
326+
condition: { field: 'operation', value: 'search' },
327+
},
328+
{
329+
id: 'country',
330+
title: 'Country',
331+
type: 'short-input',
332+
placeholder: 'ISO 3166-1 alpha-2 code (e.g., US)',
333+
mode: 'advanced',
334+
condition: { field: 'operation', value: 'search' },
335+
},
320336
{
321337
id: 'factCheck',
322338
title: 'Fact Check',
@@ -634,6 +650,8 @@ Do not include any explanations, markdown formatting, or other text outside the
634650
const exclude = toStringArray(params.excludeDomains)
635651
if (exclude?.length) result.excludeDomains = exclude
636652
setString('freshness')
653+
setNumber('numResults')
654+
setString('country')
637655
setBool('queryFanout')
638656
setBool('markdownEnabled')
639657
setNumber('timeoutMS')

apps/sim/tools/context_dev/map.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ export const contextDevMapTool: ToolConfig<ContextDevMapParams, ContextDevMapRes
8383
},
8484
meta: {
8585
type: 'object',
86-
description: 'Sitemap discovery stats (sitemapsDiscovered, sitemapsFetched, errors)',
86+
description:
87+
'Sitemap discovery stats (sitemapsDiscovered, sitemapsFetched, sitemapsSkipped, errors)',
8788
},
8889
...CREDIT_OUTPUTS,
8990
},

apps/sim/tools/context_dev/scrape_html.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@ export const contextDevScrapeHtmlTool: ToolConfig<
9999
url: { type: 'string', description: 'The scraped URL' },
100100
type: {
101101
type: 'string',
102-
description: 'Detected content type (html, xml, json, text, csv, markdown, svg, pdf)',
102+
description:
103+
'Detected content type (html, xml, json, text, csv, markdown, svg, pdf, doc, docx)',
103104
},
104105
...CREDIT_OUTPUTS,
105106
},

apps/sim/tools/context_dev/search.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,18 @@ export const contextDevSearchTool: ToolConfig<ContextDevSearchParams, ContextDev
4040
visibility: 'user-or-llm',
4141
description: 'Recency filter (last_24_hours, last_week, last_month, last_year)',
4242
},
43+
numResults: {
44+
type: 'number',
45+
required: false,
46+
visibility: 'user-or-llm',
47+
description: 'Number of results to return (10-100, default 10)',
48+
},
49+
country: {
50+
type: 'string',
51+
required: false,
52+
visibility: 'user-or-llm',
53+
description: 'Restrict results to a country (ISO 3166-1 alpha-2 code, e.g. US)',
54+
},
4355
queryFanout: {
4456
type: 'boolean',
4557
required: false,
@@ -75,6 +87,8 @@ export const contextDevSearchTool: ToolConfig<ContextDevSearchParams, ContextDev
7587
if (params.includeDomains?.length) body.includeDomains = params.includeDomains
7688
if (params.excludeDomains?.length) body.excludeDomains = params.excludeDomains
7789
if (params.freshness) body.freshness = params.freshness
90+
if (params.numResults != null) body.numResults = params.numResults
91+
if (params.country) body.country = params.country
7892
if (params.queryFanout != null) body.queryFanout = params.queryFanout
7993
if (params.markdownEnabled != null) {
8094
body.markdownOptions = { enabled: params.markdownEnabled }

apps/sim/tools/context_dev/types.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,8 @@ export interface ContextDevSearchParams {
133133
includeDomains?: string[]
134134
excludeDomains?: string[]
135135
freshness?: string
136+
numResults?: number
137+
country?: string
136138
queryFanout?: boolean
137139
markdownEnabled?: boolean
138140
timeoutMS?: number
@@ -400,7 +402,10 @@ export const BRAND_OUTPUT_PROPERTIES = {
400402
email: { type: 'string', description: 'Brand contact email' },
401403
phone: { type: 'string', description: 'Brand contact phone' },
402404
industries: { type: 'json', description: 'Industry taxonomy (eic industry/subindustry pairs)' },
403-
links: { type: 'json', description: 'Key brand links (careers, privacy, terms, blog, pricing)' },
405+
links: {
406+
type: 'json',
407+
description: 'Key brand links (careers, privacy, terms, blog, pricing, contact)',
408+
},
404409
primary_language: { type: 'string', description: 'Primary language of the brand site' },
405410
} as const
406411

apps/sim/tools/context_dev/utils.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,9 @@ export function appendParam(
7979
value: string | number | boolean | undefined | null
8080
): void {
8181
if (value === undefined || value === null || value === '') return
82-
search.append(key, String(value))
82+
const serialized = typeof value === 'string' ? value.trim() : String(value)
83+
if (serialized === '') return
84+
search.append(key, serialized)
8385
}
8486

8587
/** Output definitions for the credit accounting fields, reused across every tool. */

0 commit comments

Comments
 (0)