Skip to content

Commit 43d3ada

Browse files
authored
feat(search): add highlights parameter (#323)
1 parent 3eb1115 commit 43d3ada

5 files changed

Lines changed: 18 additions & 3 deletions

File tree

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,7 @@ Search the web and optionally extract content from search results.
432432
"name": "firecrawl_search",
433433
"arguments": {
434434
"query": "latest AI research papers 2023",
435+
"highlights": true,
435436
"limit": 5,
436437
"lang": "en",
437438
"country": "us",
@@ -444,6 +445,8 @@ Search the web and optionally extract content from search results.
444445
}
445446
```
446447

448+
Set `highlights` to `true` to request query-relevant highlights or `false` to keep the original search snippets. Omit it to use the API's default behavior.
449+
447450
**Returns:**
448451

449452
- Array of search results (with optional scraped content), plus an `id` field. Pass that `id` to `firecrawl_search_feedback` after you've used the results to refund 1 credit (search costs 2) and improve search quality.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "firecrawl-mcp",
3-
"version": "3.22.3",
3+
"version": "3.22.4",
44
"description": "MCP server for Firecrawl — search, scrape, and interact with the web. Supports both cloud and self-hosted instances. Features include web search, scraping, page interaction, batch processing, and LLM-powered content analysis.",
55
"type": "module",
66
"mcpName": "io.github.firecrawl/firecrawl-mcp-server",

server.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
{
1313
"registryType": "npm",
1414
"identifier": "firecrawl-mcp",
15-
"version": "3.22.3",
15+
"version": "3.22.4",
1616
"transport": {
1717
"type": "stdio"
1818
},

src/index.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1298,6 +1298,12 @@ The query also supports search operators, that you can use if needed to refine t
12981298
parameters: z
12991299
.object({
13001300
query: z.string().min(1),
1301+
highlights: z
1302+
.boolean()
1303+
.optional()
1304+
.describe(
1305+
'Return query-relevant highlights for each search result. Set to false to keep the original search snippets.'
1306+
),
13011307
limit: z.number().optional(),
13021308
tbs: z.string().optional(),
13031309
filter: z.string().optional(),

tests/mcp-smoke.test.mjs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,11 @@ test('HTTP cloud transport preserves Firecrawl OAuth and well-known routes', asy
319319
assert.ok(httpToolNames.includes('firecrawl_scrape'));
320320
assert.ok(httpToolNames.includes('firecrawl_search'));
321321
assert.ok(httpToolNames.includes('firecrawl_parse'));
322+
const searchTool = toolsMessage.result.tools.find(
323+
(tool) => tool.name === 'firecrawl_search'
324+
);
325+
assert.equal(searchTool.inputSchema.properties.highlights.type, 'boolean');
326+
assert.equal('default' in searchTool.inputSchema.properties.highlights, false);
322327

323328
assert.equal(stderr.includes('TypeError'), false, stderr);
324329
});
@@ -349,7 +354,7 @@ test('HTTP cloud transport calls Firecrawl API with authenticated session', asyn
349354
jsonrpc: '2.0',
350355
method: 'tools/call',
351356
params: {
352-
arguments: { limit: 1, query: 'example domain' },
357+
arguments: { highlights: false, limit: 1, query: 'example domain' },
353358
name: 'firecrawl_search',
354359
},
355360
}),
@@ -386,6 +391,7 @@ test('HTTP cloud transport calls Firecrawl API with authenticated session', asyn
386391
assert.equal(fakeApi.requests[0].url, '/v2/search');
387392
assert.equal(fakeApi.requests[0].headers.authorization, 'Bearer fc-http-test');
388393
assert.deepEqual(fakeApi.requests[0].body, {
394+
highlights: false,
389395
limit: 1,
390396
origin: 'mcp-fastmcp',
391397
query: 'example domain',

0 commit comments

Comments
 (0)