feat(gov): return law results with legal labels from firecrawl_gov_search
firecrawl_gov_search now requests sources=law from /v2/search/gov and returns the law results. Each row in structuredContent.results keeps url, title, description and position, and also carries the Government Index's legal labels when the index has them: jurisdiction, court, court_type, cites, cited_as and updated_at.
The law group lists the same results in the same order as web, so the text block (## <position>. <title>, URL, snippet) reads exactly as before. The tool description, input schema and server instructions are unchanged. The output schema already allows extra fields on each row, so the contract snapshots don't change.
Draft until the API ships sources: https://github.com/firecrawl/firecrawl/pull/5354 adds sources and data.law to /v2/search/gov. Until that is deployed, the API rejects the sources parameter with a 400, so this PR must not merge before it.
Tests
tests/mcp-search-profile.test.mjs: the fake backend now answers withdata.law. The test asserts that the request sendssources=lawexactly once, that the text block is unchanged, and thatstructuredContent.resultscarries the labels.- Locally:
tsc --noEmit,pnpm lintand the fullpnpm test(225 pass) all pass.
Docs: https://github.com/firecrawl/firecrawl-docs/pull/1708.
Summary by cubic
firecrawl_gov_search now requests sources=law from /v2/search/gov and returns the law results instead of the web results.
- Each row in
structuredContent.resultskeepsurl,title,descriptionandposition, and carries the index's legal labels (jurisdiction,court,court_type,cites,cited_as,updated_at) when available. - The rendered text block stays identical, and the tool description, input schema, and output contract are unchanged.
- Falls back to
webresults when the API ignoressourcesand only answersweb.
Migration: Do not merge until the API supports sources (firecrawl/firecrawl#5354); if the API rejects the parameter with a 400, the fallback does not apply.