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

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.