mirror of
https://github.com/vxcontrol/pentagi.git
synced 2026-08-24 20:16:30 +00:00
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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user