Skip to content

feat(gov): return law results with legal labels from firecrawl_gov_search - #599

Draft
erikengervall wants to merge 8 commits into
mainfrom
capy/gov-search-law-results
Draft

erikengervall wants to merge 8 commits into
mainfrom
capy/gov-search-law-results

Conversation

@erikengervall

@erikengervall erikengervall commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

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: firecrawl/firecrawl#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 with data.law. The test asserts that the request sends sources=law exactly once, that the text block is unchanged, and that structuredContent.results carries the labels.
  • Locally: tsc --noEmit, pnpm lint and the full pnpm test (225 pass) all pass.

Docs: firecrawl/firecrawl-docs#1708.

Open in Capy


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.results keeps url, title, description and position, 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 web results when the API ignores sources and only answers web.

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.

Written for commit d27129b. Summary will update on new commits.

View guided diff Turn on auto-fix

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant