Skip to main content
Glama
paulieb89

GOV UK Search

by paulieb89

Search GOV.UK

govuk_search
Read-onlyIdempotent

Search all of GOV.UK's content items—including guides, transactions, and publications—by keyword. Filter results by document type or government department to find official information quickly.

Instructions

Search GOV.UK's 700k+ content items using the official Search API.

Returns a list of matching content items with title, description, link, format, owning organisation(s), and last updated timestamp.

Use filter_format to narrow to specific content types (e.g. 'transaction' for citizen-facing services, 'guide' for guidance, 'publication' for official documents). Use filter_organisations to restrict to a department.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesFree-text search query, e.g. 'universal credit eligibility' or 'MOT check'
countNoNumber of results to return (1–50)
startNoOffset for pagination, e.g. 10 for the second page of 10 results
filter_formatNoFilter by document format. Common values: 'guide', 'answer', 'transaction', 'publication', 'news_article', 'detailed_guide', 'hmrc_manual_section', 'travel_advice', 'organisation'. Leave blank to search all types.
filter_organisationsNoFilter by organisation slug, e.g. 'hm-revenue-customs', 'department-for-work-pensions', 'driver-and-vehicle-standards-agency'.
orderNoSort order. Use '-public_timestamp' for newest-first (default relevance).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesThe free-text query that was searched.
totalYesTotal matching results across all pages on GOV.UK.
startYesOffset used for this page (zero-based).
countYesMax results requested for this page.
returnedYesNumber of results actually returned in this response.
has_moreYesTrue if more results exist beyond this page. Re-call with start=start+returned to fetch the next page.
resultsNoMatching pages. Use the `link` field of any result as the `base_path` input to govuk_get_content for the full item.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed8 schema fields changed
    • addedInput schema / properties / count
      Added value: +{
      +  "default": 10,
      +  "description": "Number of results to return (1–50)",
      +  "maximum": 50,
      +  "minimum": 1,
      +  "type": "integer"
      +}
    • addedInput schema / properties / filter_format
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Filter by document format. Common values: 'guide', 'answer', 'transaction', 'publication', 'news_article', 'detailed_guide', 'hmrc_manual_section', 'travel_advice', 'organisation'. Leave blank to search all types."
      +}
    • addedInput schema / properties / filter_organisations
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Filter by organisation slug, e.g. 'hm-revenue-customs', 'department-for-work-pensions', 'driver-and-vehicle-standards-agency'."
      +}
    • addedInput schema / properties / order
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Sort order. Use '-public_timestamp' for newest-first (default relevance)."
      +}
    • removedInput schema / properties / params
      Removed value: -{
      -  "additionalProperties": false,
      -  "description": "SearchInput with query, count, start, optional format/org\nfilters, and optional sort order.",
      -  "properties": {
      -    "count": {
      -      "default": 10,
      -      "description": "Number of results to return (1–50)",
      -      "maximum": 50,
      -      "minimum": 1,
      -      "type": "integer"
      -    },
      -    "filter_format": {
      -      "anyOf": [
      -        {
      -          "type": "string"
      -        },
      -        {
      -          "type": "null"
      -        }
      -      ],
      -      "default": null,
      -      "description": "Filter by document format. Common values: 'guide', 'answer', 'transaction', 'publication', 'news_article', 'detailed_guide', 'hmrc_manual_section', 'travel_advice', 'organisation'. Leave blank to search all types."
      -    },
      -    "filter_organisations": {
      -      "anyOf": [
      -        {
      -          "type": "string"
      -        },
      -        {
      -          "type": "null"
      -        }
      -      ],
      -      "default": null,
      -      "description": "Filter by organisation slug, e.g. 'hm-revenue-customs', 'department-for-work-pensions', 'driver-and-vehicle-standards-agency'."
      -    },
      -    "order": {
      -      "anyOf": [
      -        {
      -          "type": "string"
      -        },
      -        {
      -          "type": "null"
      -        }
      -      ],
      -      "default": null,
      -      "description": "Sort order. Use '-public_timestamp' for newest-first (default relevance)."
      -    },
      -    "query": {
      -      "description": "Free-text search query, e.g. 'universal credit eligibility' or 'MOT check'",
      -      "maxLength": 500,
      -      "minLength": 1,
      -      "type": "string"
      -    },
      -    "start": {
      -      "default": 0,
      -      "description": "Offset for pagination, e.g. 10 for the second page of 10 results",
      -      "minimum": 0,
      -      "type": "integer"
      -    }
      -  },
      -  "required": [
      -    "query"
      -  ],
      -  "type": "object"
      -}
    • addedInput schema / properties / query
      Added value: +{
      +  "description": "Free-text search query, e.g. 'universal credit eligibility' or 'MOT check'",
      +  "maxLength": 500,
      +  "minLength": 1,
      +  "type": "string"
      +}
    • addedInput schema / properties / start
      Added value: +{
      +  "default": 0,
      +  "description": "Offset for pagination, e.g. 10 for the second page of 10 results",
      +  "minimum": 0,
      +  "type": "integer"
      +}
    • changedInput schema / required
      Previous value: -[
      -  "params"
      -]New value: +[
      +  "query"
      +]
  2. First observedv0.2.0

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, openWorldHint, idempotentHint, and non-destructive. The description adds useful behavioral context beyond annotations: it mentions the official Search API, the scale of 700k+ items, and the exact fields returned in the result list. This enriches the agent's understanding without contradicting annotations.

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 compact and well-structured: opening sentence states purpose, second sentence summarizes return shape, final sentence gives filter usage. No filler or redundancy; every sentence contributes useful information.

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?

With a rich output schema, detailed annotations, and full schema parameter descriptions, the description covers the core search behavior and filter usage effectively. It lacks explicit guidance on pagination or when not to use this tool, but overall it is sufficient for an agent to select and invoke it correctly.

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

Parameters4/5

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

Schema coverage is 100%, so baseline is 3. The description goes beyond schema by giving real-world meaning to filter_format ('transaction' for citizen-facing services, 'guide' for guidance) and explaining the purpose of filter_organisations ('restrict to a department'). This adds semantic value for correctly using these parameters.

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 opens with a specific verb and resource: 'Search GOV.UK's 700k+ content items using the official Search API.' It clearly distinguishes from sibling tools like govuk_get_content by emphasizing broad search across all content, and it details what is returned (title, description, link, format, organisation, timestamp).

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

Usage Guidelines3/5

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

The description explains how to use filters ('Use filter_format... Use filter_organisations...'), but it does not explicitly say when to choose this tool over siblings such as govuk_get_content or govuk_grep_content. The search use case is implied but not contrasted with alternatives.

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