Full-text search across a cached document's extracted text
search_documentSearch within a government document for a specific phrase and get matching page numbers with context snippets. Use when document landmarks don't list your target topic. Requires jurisdiction and document ID. Limits to 20 hits by default.
Instructions
Locate pages containing a phrase. Returns matching page numbers + short context snippets for navigation. Useful when the outline/landmarks don't list your target (e.g. you want 'directors' remuneration' but only 'Directors Report' is a landmark). Up to max_hits pages (default 20) are returned; total_hits counts raw matches across the document.
CRITICAL — snippets are NAVIGATION AIDS ONLY and may contain OCR errors. Once you've identified target pages, call fetch_document_pages(pages=) to read the authoritative text / bytes before citing anything.
Requires get_document_navigation (or fetch_document on a PDF) to have run first so the per-page text index exists in R2.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| jurisdiction | Yes | ISO 3166-1 alpha-2 country code (uppercase). All registries are official government sources. Currently supported: AU, BE, CA, CA-BC, CA-NT, CH, CY, CZ, DE, ES, FI, FR, GB, HK, IE, IM, IS, IT, KR, KY, LI, MC, MX, MY, NL, NO, NZ, PL, RU, TW. Per-country capability, ID format, examples, status mapping, and caveats: call `list_jurisdictions({jurisdiction:'<code>'})`. To find which countries support a specific tool: `list_jurisdictions({supports_tool:'<tool>'})`. | |
| document_id | Yes | ||
| query | Yes | Phrase to search for. Case-insensitive. | |
| max_hits | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| queried_at | Yes | ISO-8601 + Europe/London timezone stamp for when the registry was queried. | |
| jurisdiction | No | ||
| document_id | No | ||
| query | No | ||
| matches | No |