Skip to main content
Glama

Search within a GOV.UK content body

govuk_grep_content
Read-onlyIdempotent

Search 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

TableJSON Schema
NameRequiredDescriptionDefault
paramsYesInput schema for govuk_grep_content.

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
Behavior4/5

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

Annotations already provide readOnlyHint=true, destructiveHint=false, idempotentHint=true, and openWorldHint=true, covering safety and idempotency. The description adds valuable behavioral context beyond annotations: it explains the fallback behavior (regex to literal substring), describes the return format (list of hits with specific fields), and mentions the purpose of snippets for LLM decision-making. No contradictions with annotations exist.

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?

The description is efficiently structured with four sentences that each serve a distinct purpose: stating the core function, describing the return format and its use, providing usage guidelines, and explaining pattern behavior. There is no wasted text, and key information is front-loaded.

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

Completeness5/5

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

Given the tool's moderate complexity, rich annotations (covering safety and idempotency), comprehensive schema coverage (100%), and the presence of an output schema (implied by context signals), the description is complete. It adequately explains the tool's purpose, usage context, behavioral nuances, and integrates well with sibling tools without needing to detail return values or parameters.

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 description coverage is 100%, so the schema fully documents all parameters (base_path, pattern, case_insensitive, max_hits). The description adds minimal semantic value beyond the schema, only briefly mentioning the regex/literal fallback for 'pattern' and the snippet purpose, which is partially redundant with schema descriptions. Baseline 3 is appropriate given the comprehensive schema coverage.

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?

The description clearly states the tool's purpose with specific verbs ('Find body sections', 'search within') and resources ('GOV.UK content item'), distinguishing it from sibling tools like govuk_search (which discovers base_paths) and read_resource (which reads full content). It explicitly mentions the target resource type and the matching operation.

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?

The description provides explicit guidance on when to use this tool ('when answering content-based questions') versus alternatives ('navigating by section number which uses the index resource'). It also references govuk_search for discovering base_paths, offering clear context for proper tool selection.

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