Skip to content

Commit af4d72d

Browse files
committed
fix(firecrawl): declare news and image result fields in the search output schema
1 parent 9cc0a93 commit af4d72d

3 files changed

Lines changed: 49 additions & 8 deletions

File tree

‎apps/docs/content/docs/integrations/firecrawl.mdx‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,14 +156,20 @@ Search for information on the web using Firecrawl
156156
| --------- | ---- | ----------- |
157157
| `data` | array | Search results data with scraped content and metadata |
158158
| ↳ `title` | string | Search result title from search engine |
159-
| ↳ `description` | string | Search result description/snippet from search engine |
159+
| ↳ `description` | string | Search result description/snippet from search engine; web results only |
160160
| ↳ `url` | string | URL of the search result |
161+
| ↳ `snippet` | string | News result snippet; news results only |
162+
| ↳ `date` | string | News publication date; news results only |
163+
| ↳ `imageUrl` | string | Image URL; image results, and news results that carry one |
164+
| ↳ `imageWidth` | number | Image width in pixels; image results only |
165+
| ↳ `imageHeight` | number | Image height in pixels; image results only |
166+
| ↳ `position` | number | Rank within its source; news and image results only |
161167
| ↳ `markdown` | string | Page content in markdown; returned only when scraping was requested via the hidden scrapeOptions input |
162168
| ↳ `html` | string | Processed HTML content; returned only when "html" is among the scrape formats requested via the hidden scrapeOptions input |
163169
| ↳ `rawHtml` | string | Unprocessed raw HTML; returned only when "rawHtml" is among the scrape formats requested via the hidden scrapeOptions input |
164170
| ↳ `links` | array | Links found on the page; returned only when "links" is among the scrape formats requested via the hidden scrapeOptions input |
165171
| ↳ `screenshot` | string | Screenshot URL \(expires after 24 hours\); returned only when "screenshot" is among the scrape formats requested via the hidden scrapeOptions input |
166-
| ↳ `metadata` | object | Metadata about the search result page |
172+
| ↳ `metadata` | object | Metadata about the search result page; web and news results only |
167173
| ↳ `title` | string | Page title |
168174
| ↳ `description` | string | Page meta description |
169175
| ↳ `sourceURL` | string | Original source URL |

‎apps/sim/tools/firecrawl/types.ts‎

Lines changed: 40 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,8 @@ export const SEARCH_METADATA_OUTPUT_PROPERTIES = {
120120
*/
121121
export const SEARCH_METADATA_OUTPUT: OutputProperty = {
122122
type: 'object',
123-
description: 'Metadata about the search result page',
123+
description: 'Metadata about the search result page; web and news results only',
124+
optional: true,
124125
properties: SEARCH_METADATA_OUTPUT_PROPERTIES,
125126
}
126127

@@ -154,9 +155,36 @@ export const SEARCH_RESULT_OUTPUT_PROPERTIES = {
154155
title: { type: 'string', description: 'Search result title from search engine' },
155156
description: {
156157
type: 'string',
157-
description: 'Search result description/snippet from search engine',
158+
description: 'Search result description/snippet from search engine; web results only',
159+
optional: true,
158160
},
159161
url: { type: 'string', description: 'URL of the search result' },
162+
snippet: {
163+
type: 'string',
164+
description: 'News result snippet; news results only',
165+
optional: true,
166+
},
167+
date: { type: 'string', description: 'News publication date; news results only', optional: true },
168+
imageUrl: {
169+
type: 'string',
170+
description: 'Image URL; image results, and news results that carry one',
171+
optional: true,
172+
},
173+
imageWidth: {
174+
type: 'number',
175+
description: 'Image width in pixels; image results only',
176+
optional: true,
177+
},
178+
imageHeight: {
179+
type: 'number',
180+
description: 'Image height in pixels; image results only',
181+
optional: true,
182+
},
183+
position: {
184+
type: 'number',
185+
description: 'Rank within its source; news and image results only',
186+
optional: true,
187+
},
160188
markdown: {
161189
type: 'string',
162190
description:
@@ -372,16 +400,23 @@ export interface ScrapeResponse extends ToolResponse {
372400

373401
export interface SearchResponse extends ToolResponse {
374402
output: {
403+
/** Web, then news, then image results; each source fills only its own fields. */
375404
data: Array<{
376-
title: string
377-
description: string
405+
title?: string
406+
description?: string
378407
url: string
408+
snippet?: string
409+
date?: string
410+
imageUrl?: string
411+
imageWidth?: number
412+
imageHeight?: number
413+
position?: number
379414
markdown?: string
380415
html?: string
381416
rawHtml?: string
382417
links?: string[]
383418
screenshot?: string
384-
metadata: {
419+
metadata?: {
385420
title?: string
386421
description?: string
387422
sourceURL: string

‎apps/sim/tools/generated/tool-outputs.ts‎

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)