Search within a GOV.UK content body
govuk_grep_contentSearch GOV.UK content for specific text patterns to answer content-based questions by returning relevant section snippets with matches.
Instructions
Find body sections in a GOV.UK content item matching a pattern.
Returns a list of {anchor, heading, snippet, match} hits — small per-section
snippets centred on the match — so the LLM can decide which full sections to
read via govuk://content/{base_path}/section/{anchor}.
Use this when answering content-based questions ("what does this guide say about X?", "find the bit about eligibility") rather than navigating by section number (which uses the index resource).
Pattern is regex; if it doesn't compile, falls back to literal substring.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| params | Yes | Input schema for govuk_grep_content. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| base_path | Yes | The content item that was searched | |
| pattern | Yes | The pattern that was searched for | |
| hits | Yes | Matching sections in document order | |
| truncated | Yes | True if hit count reached max_hits and more matches may exist |