Skip to main content
Glama

Search within a GOV.UK content body

govuk_grep_content
Read-onlyIdempotent

Search GOV.UK pages for a pattern and return matching sections with snippets. Use to answer content-based questions like 'what does this guide say about X?'

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_get_section.

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.

Pattern is regex; if it doesn't compile, falls back to literal substring.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
base_pathYesGOV.UK base_path, e.g. '/guidance/register-for-vat' or '/universal-credit'
patternYesRegex or literal substring to search for within the page body, e.g. 'payment' or 'eligible.*income'
case_insensitiveNoIf true (default), match case-insensitively
max_hitsNoMaximum number of matching sections to return (1–100)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
base_pathYesThe content item that was searched
patternYesThe pattern that was searched for
hitsYesMatching sections in document order
truncatedYesTrue if hit count reached max_hits and more matches may exist
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Describes return format (list of {anchor, heading, snippet, match}), that snippets are small and per-section, and pattern fallback. Annotations already provide readOnlyHint, destructiveHint, etc., and description adds context without contradiction.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Description is concise, 4 sentences, front-loaded with purpose, then output format, usage hint, and pattern behavior. No wasted words, well-structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the presence of an output schema and detailed input schema, description covers key behavioral aspects: output format, intended usage, pattern fallback. Could mention max_hits behavior but schema handles it.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so baseline is 3. Description adds minor value by noting pattern regex fallback, but schema already defines pattern as 'Regex or literal substring'. Other parameters are sufficiently described in schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states 'Find body sections in a GOV.UK content item matching a pattern.' Differentiates from siblings by contrasting with navigating by section number and referencing govuk_get_section for full sections.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly states 'Use this when answering content-based questions... rather than navigating by section number.' Also explains pattern behavior (regex with fallback) and that results are snippets for LLM to decide next step.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/paulieb89/govuk-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server