Skip to content

Commit b97e107

Browse files
add query format support (#187) (#190)
* add query format support to scrape tool * bump version to 3.12.0 * prefer markdown over query format in scrape tool description MCP agents can read and reason over scraped content directly — the query format is redundant when the agent already has the scrape result. default guidance now recommends markdown.
1 parent 655c9f6 commit b97e107

2 files changed

Lines changed: 23 additions & 2 deletions

File tree

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.11.0",
3+
"version": "3.12.0",
44
"description": "MCP server for Firecrawl web scraping integration. Supports both cloud and self-hosted instances. Features include web scraping, search, batch processing, structured data extraction, and LLM-powered content analysis.",
55
"type": "module",
66
"mcpName": "io.github.firecrawl/firecrawl-mcp-server",

src/index.ts

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,9 @@ function buildFormatsArray(
193193
if (fmt === 'json') {
194194
const jsonOpts = args.jsonOptions as Record<string, unknown> | undefined;
195195
result.push({ type: 'json', ...jsonOpts });
196+
} else if (fmt === 'query') {
197+
const queryOpts = args.queryOptions as Record<string, unknown> | undefined;
198+
result.push({ type: 'query', ...queryOpts });
196199
} else if (fmt === 'screenshot' && args.screenshotOptions) {
197200
const ssOpts = args.screenshotOptions as Record<string, unknown>;
198201
result.push({ type: 'screenshot', ...ssOpts });
@@ -245,6 +248,7 @@ function transformScrapeParams(
245248
if (parsers) out.parsers = parsers;
246249

247250
delete out.jsonOptions;
251+
delete out.queryOptions;
248252
delete out.screenshotOptions;
249253
delete out.pdfOptions;
250254

@@ -265,6 +269,7 @@ const scrapeParamsSchema = z.object({
265269
'changeTracking',
266270
'branding',
267271
'json',
272+
'query',
268273
])
269274
)
270275
.optional(),
@@ -274,6 +279,11 @@ const scrapeParamsSchema = z.object({
274279
schema: z.record(z.string(), z.any()).optional(),
275280
})
276281
.optional(),
282+
queryOptions: z
283+
.object({
284+
prompt: z.string().max(10000),
285+
})
286+
.optional(),
277287
screenshotOptions: z
278288
.object({
279289
fullPage: z.boolean().optional(),
@@ -390,7 +400,18 @@ If JSON extraction returns empty, minimal, or just navigation content, the page
390400
}
391401
}
392402
\`\`\`
393-
**Usage Example (markdown format - ONLY when full content genuinely needed):**
403+
404+
**Prefer markdown format by default.** You can read and reason over the full page content directly — no need for an intermediate query step. Use markdown for questions about page content, factual lookups, and any task where you need to understand the page.
405+
406+
**Use JSON format when user needs:**
407+
- Structured data with specific fields (extract all products with name, price, description)
408+
- Data in a specific schema for downstream processing
409+
410+
**Use query format only when:**
411+
- The page is extremely long and you need a single targeted answer without processing the full content
412+
- You want a quick factual answer and don't need to retain the page content
413+
414+
**Usage Example (markdown format - default for most tasks):**
394415
\`\`\`json
395416
{
396417
"name": "firecrawl_scrape",

0 commit comments

Comments
 (0)