From bb44c9961dd1919ccadef9fb5f9a3eebf8483b92 Mon Sep 17 00:00:00 2001 From: rramprakash Date: Thu, 16 Jul 2026 12:36:04 +0530 Subject: [PATCH] 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. --- backend/pkg/tools/firecrawl.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/backend/pkg/tools/firecrawl.go b/backend/pkg/tools/firecrawl.go index 5db5817b..10902157 100644 --- a/backend/pkg/tools/firecrawl.go +++ b/backend/pkg/tools/firecrawl.go @@ -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,