fix(firecrawl): omit sources from search request

Verified against the live /v2/search API: the response envelope only ever
populates data.web for this tool, and sources defaults to ["web"] when
omitted. The sources field carries a string-vs-object shape ambiguity across
the API/SDK/MCP layers (the Firecrawl MCP rejects string sources outright),
so dropping it removes a needless compatibility risk without changing
behaviour.
This commit is contained in:
rramprakash
2026-07-16 12:53:11 +05:30
parent 4245be118a
commit bb44c9961d
+5 -4
View File
@@ -26,7 +26,6 @@ const (
type firecrawlRequest struct {
Query string `json:"query"`
Limit int `json:"limit,omitempty"`
Sources []string `json:"sources,omitempty"`
ScrapeOptions *firecrawlScrapeOptions `json:"scrapeOptions,omitempty"`
}
@@ -172,10 +171,12 @@ func (f *firecrawl) search(ctx context.Context, query string, maxResults int) (s
return "", fmt.Errorf("failed to create http client: %w", err)
}
// sources is intentionally omitted: /v2/search defaults to ["web"], which is
// all this tool consumes, and it avoids the string-vs-object shape ambiguity
// that field carries across the API/SDK layers.
reqPayload := firecrawlRequest{
Query: query,
Limit: maxResults,
Sources: []string{"web"},
Query: query,
Limit: maxResults,
ScrapeOptions: &firecrawlScrapeOptions{
Formats: []string{"markdown"},
OnlyMainContent: true,