Skip to main content
Glama

Search UK Legislation

legislation_search
Read-onlyIdempotent

USE THIS TOOL WHEN searching UK Acts and Statutory Instruments by title, phrase, or full-text.

Returns ranked results: title, type, year, number, legislation.gov.uk URL, and next_steps hints (toc URI, section template). AFTER calling, chain to legislation_get_toc then legislation_get_section for structural drill-in.

Filter discipline: type and year are exact-match. Use only when you already know the value. For currency-driven searches ("the recent Renters' Rights Act"), query by phrase alone and read the year from the results — guessing a year and filtering by it zeroes results when wrong. For broader concept queries across content, set fulltext=True.

Authoritative source for UK primary and secondary legislation (legislation.gov.uk).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
typeNoFilter by type: 'ukpga' (Acts), 'uksi' (SIs), 'asp' (Scottish Acts), 'nia' (NI Acts). Exact-match — omit if you don't already know whether you're looking for an Act vs an SI.
yearNoFilter by year of enactment (exact-match — a single integer, not a range). Omit unless you already know the Act's year. Speculating a year (e.g. 'this is recent so it must be 2026') and getting it wrong will zero out the result set. Better workflow: query without `year`, then read the year from the returned results.
limitNoMaximum results to return (1–50). Passed to the upstream results-count param.
queryYesSearch query, e.g. 'Housing Act 1988' or 'data protection personal data'
fulltextNoDefault false → searches Act/SI titles only (best for finding a named Act, e.g. 'Housing Act 1988' returns ukpga/1988/50 first). Set true to search the full text of every Act/SI for the query (returns SIs and regulations that cite the term — e.g. 'rental deposits' would return many implementing instruments).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
totalYesTotal number of matches
resultsYesMatching legislation items

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Changed7 schema fields changed
    • addedInput schema / properties / fulltext
      Added value: +{
      +  "default": false,
      +  "description": "Default false → searches Act/SI titles only (best for finding a named Act, e.g. 'Housing Act 1988' returns ukpga/1988/50 first). Set true to search the full text of every Act/SI for the query (returns SIs and regulations that cite the term — e.g. 'rental deposits' would return many implementing instruments).",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / limit
      Added value: +{
      +  "default": 20,
      +  "description": "Maximum results to return (1–50). Passed to the upstream results-count param.",
      +  "maximum": 50,
      +  "minimum": 1,
      +  "type": "integer"
      +}
    • removedInput schema / properties / params
      Removed value: -{
      -  "additionalProperties": false,
      -  "description": "LegislationSearchInput.",
      -  "properties": {
      -    "fulltext": {
      -      "default": false,
      -      "description": "Default false → searches Act/SI titles only (best for finding a named Act, e.g. 'Housing Act 1988' returns ukpga/1988/50 first). Set true to search the full text of every Act/SI for the query (returns SIs and regulations that cite the term — e.g. 'rental deposits' would return many implementing instruments).",
      -      "type": "boolean"
      -    },
      -    "limit": {
      -      "default": 20,
      -      "description": "Maximum results to return (1–50). Passed to the upstream results-count param.",
      -      "maximum": 50,
      -      "minimum": 1,
      -      "type": "integer"
      -    },
      -    "query": {
      -      "description": "Search query, e.g. 'Housing Act 1988' or 'data protection personal data'",
      -      "maxLength": 500,
      -      "minLength": 1,
      -      "type": "string"
      -    },
      -    "type": {
      -      "anyOf": [
      -        {
      -          "type": "string"
      -        },
      -        {
      -          "type": "null"
      -        }
      -      ],
      -      "default": null,
      -      "description": "Filter by type: 'ukpga' (Acts), 'uksi' (SIs), 'asp' (Scottish Acts), 'nia' (NI Acts). Exact-match — omit if you don't already know whether you're looking for an Act vs an SI."
      -    },
      -    "year": {
      -      "anyOf": [
      -        {
      -          "maximum": 2100,
      -          "minimum": 1800,
      -          "type": "integer"
      -        },
      -        {
      -          "type": "null"
      -        }
      -      ],
      -      "default": null,
      -      "description": "Filter by year of enactment (exact-match — a single integer, not a range). Omit unless you already know the Act's year. Speculating a year (e.g. 'this is recent so it must be 2026') and getting it wrong will zero out the result set. Better workflow: query without `year`, then read the year from the returned results."
      -    }
      -  },
      -  "required": [
      -    "query"
      -  ],
      -  "type": "object"
      -}
    • addedInput schema / properties / query
      Added value: +{
      +  "description": "Search query, e.g. 'Housing Act 1988' or 'data protection personal data'",
      +  "maxLength": 500,
      +  "minLength": 1,
      +  "type": "string"
      +}
    • addedInput schema / properties / type
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Filter by type: 'ukpga' (Acts), 'uksi' (SIs), 'asp' (Scottish Acts), 'nia' (NI Acts). Exact-match — omit if you don't already know whether you're looking for an Act vs an SI."
      +}
    • addedInput schema / properties / year
      Added value: +{
      +  "anyOf": [
      +    {
      +      "maximum": 2100,
      +      "minimum": 1800,
      +      "type": "integer"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Filter by year of enactment (exact-match — a single integer, not a range). Omit unless you already know the Act's year. Speculating a year (e.g. 'this is recent so it must be 2026') and getting it wrong will zero out the result set. Better workflow: query without `year`, then read the year from the returned results."
      +}
    • changedInput schema / required
      Previous value: -[
      -  "params"
      -]New value: +[
      +  "query"
      +]
  2. Changed1 schema field changed
    • addedInput schema / properties / params / properties / limit
      Added value: +{
      +  "default": 20,
      +  "description": "Maximum results to return (1–50). Passed to the upstream results-count param.",
      +  "maximum": 50,
      +  "minimum": 1,
      +  "type": "integer"
      +}
  3. Changed1 schema field changed
    • changedInput schema / properties / params / description
      Previous value: -"LegislationSearchInput with query, optional type filter, optional year."New value: +"LegislationSearchInput."
  4. Changed2 schema fields changed
    • changedInput schema / properties / params / properties / type / description
      Previous value: -"Filter by type: 'ukpga' (Acts), 'uksi' (SIs), 'asp' (Scottish Acts), 'nia' (NI Acts)"New value: +"Filter by type: 'ukpga' (Acts), 'uksi' (SIs), 'asp' (Scottish Acts), 'nia' (NI Acts). Exact-match — omit if you don't already know whether you're looking for an Act vs an SI."
    • changedInput schema / properties / params / properties / year / description
      Previous value: -"Filter by year of enactment"New value: +"Filter by year of enactment (exact-match — a single integer, not a range). Omit unless you already know the Act's year. Speculating a year (e.g. 'this is recent so it must be 2026') and getting it wrong will zero out the result set. Better workflow: query without `year`, then read the year from the returned results."
  5. Changed3 schema fields changed
    • changedOutput schema / properties / results / items / properties / number / description
      Previous value: -"Chapter or SI number"New value: +"Chapter (for Acts) or SI number. Part of the {type}/{year}/{number} triple that identifies an Act or SI."
    • changedOutput schema / properties / results / items / properties / type / description
      Previous value: -"Legislation type code, e.g. 'ukpga', 'uksi'"New value: +"Legislation type code, e.g. 'ukpga' (UK Public General Act), 'uksi' (Statutory Instrument), 'asp' (Scottish Parliament Act). Use with `year` and `number` as the triple {type}/{year}/{number} in the legislation_get_toc / legislation_get_section tools, or in legislation://{type}/{year}/{number}/section/{section}{?date} resource URIs."
    • changedOutput schema / properties / results / items / properties / year / description
      Previous value: -"Year of enactment or making"New value: +"Year of enactment or making. Part of the {type}/{year}/{number} triple that identifies an Act or SI."
  6. Changed1 schema field changed
    • addedInput schema / properties / params / description
      Added value: +"LegislationSearchInput with query, optional type filter, optional year."
  7. Changed1 schema field changed
    • addedOutput schema / properties / results / items / properties / next_steps
      Added value: +{
      +  "additionalProperties": {
      +    "type": "string"
      +  },
      +  "description": "Canonical resource URIs for reading this Act/SI. Read `toc` to discover sections, then `section_template` (substitute the section number) for the section text. Both URIs accept an optional ?date=YYYY-MM-DD query for point-in-time historical research.",
      +  "type": "object"
      +}
  8. Changed2 schema fields changed
    • addedInput schema / properties / params / properties / fulltext
      Added value: +{
      +  "default": false,
      +  "description": "Default false → searches Act/SI titles only (best for finding a named Act, e.g. 'Housing Act 1988' returns ukpga/1988/50 first). Set true to search the full text of every Act/SI for the query (returns SIs and regulations that cite the term — e.g. 'rental deposits' would return many implementing instruments).",
      +  "type": "boolean"
      +}
    • changedInput schema / properties / params / properties / query / description
      Previous value: -"Search query, e.g. 'data protection personal data'"New value: +"Search query, e.g. 'Housing Act 1988' or 'data protection personal data'"
  9. Changed6 schema fields changed
    • changedOutput schema / description
      Previous value: -"Generic wrapper for non-object return types."New value: +"Container for legislation search results."
    • removedOutput schema / properties / result
      Removed value: -{
      -  "type": "string"
      -}
    • addedOutput schema / properties / results
      Added value: +{
      +  "description": "Matching legislation items",
      +  "items": {
      +    "description": "Single legislation search result.",
      +    "properties": {
      +      "number": {
      +        "description": "Chapter or SI number",
      +        "type": "integer"
      +      },
      +      "score": {
      +        "anyOf": [
      +          {
      +            "type": "number"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "Relevance score from Lex API (higher = more relevant)"
      +      },
      +      "title": {
      +        "description": "Full title of the legislation",
      +        "type": "string"
      +      },
      +      "type": {
      +        "description": "Legislation type code, e.g. 'ukpga', 'uksi'",
      +        "type": "string"
      +      },
      +      "url": {
      +        "description": "Canonical legislation.gov.uk URL",
      +        "type": "string"
      +      },
      +      "year": {
      +        "description": "Year of enactment or making",
      +        "type": "integer"
      +      }
      +    },
      +    "required": [
      +      "title",
      +      "type",
      +      "year",
      +      "number",
      +      "url"
      +    ],
      +    "type": "object"
      +  },
      +  "type": "array"
      +}
    • addedOutput schema / properties / total
      Added value: +{
      +  "description": "Total number of matches",
      +  "type": "integer"
      +}
    • changedOutput schema / required
      Previous value: -[
      -  "result"
      -]New value: +[
      +  "results",
      +  "total"
      +]
    • removedOutput schema / x-fastmcp-wrap-result
      Removed value: -true
  10. First observed

TDQS

A5/5.0
Behavior5/5

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

Annotations already mark readOnly=true, openWorld=true, idempotent=true, destructive=false; the description adds concrete behavioral details: ranked results with fields (title, type, year, number, URL), next_steps hints, and the zeroing-out risk when filtering by a guessed year. There is no contradiction with 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 dense but well-structured, front-loading the purpose in the first sentence and using bolded warnings and examples. Every sentence provides actionable guidance, and no filler or redundancy is present, despite its length.

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?

The description fully covers what an agent needs to select and invoke the tool: when to use it, how to filter, what to expect in results, and how to chain it with sibling tools. With an output schema also present and comprehensive annotations, the description is contextually complete.

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

Parameters5/5

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

Even though schema coverage is 100%, the description enriches parameter semantics with strategic guidance: 'guessing a year and filtering by it zeroes results when wrong', the phrase-plus-read-year workflow, and clear guidance on when to set fulltext=True. This adds real decision-making value beyond the schema's field descriptions.

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 'USE THIS TOOL WHEN searching UK Acts and Statutory Instruments by title, phrase, or full-text,' which specifies a concrete verb, resource, and scope. It clearly differentiates from sibling tools like case_law_search and bills_search_bills by targeting UK legislation, and from legislation_get_toc/section by focusing on search rather than drill-down.

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?

It provides explicit usage guidance: 'USE THIS TOOL WHEN...', a chaining workflow ('AFTER calling, chain to legislation_get_toc then legislation_get_section'), and filter discipline ('Use only when you already know the value' for exact-match filters). It also offers alternative strategies for currency-driven and full-text queries, making when-to-use vs. alternatives clear.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

TDQS

A4.4/5.0
Disambiguation5/5

Every tool has a clearly distinct purpose, with detailed descriptions that prevent ambiguity. Tools covering similar domains (e.g., multiple parliament search tools) are carefully differentiated by their search approach and input requirements.

Naming Consistency5/5

All tools follow a consistent snake_case verb_noun pattern (e.g., bills_get_bill, case_law_search, citations_resolve). Even generic tools adhere to this style. No mixing of conventions.

Tool Count4/5

With 35 tools, the count is on the higher side but appropriate for the wide-ranging domain of UK legal research. Each tool contributes to specific sub-domains (bills, case law, citations, committees, HMRC, legislation, parliament, votes) without unnecessary duplication.

Completeness5/5

The tool surface covers nearly all essential aspects of UK legal research: searching and retrieving bills, case law, and legislation; parsing and resolving citations; exploring committee evidence; accessing Hansard debates and member interests; and checking HMRC guidance and VAT rates. Gaps like full judgment text retrieval are mitigated by paragraph-level access and indexing.