Skip to main content
Glama

Search UK Legislation

ukleg.legislation.search
Read-onlyIdempotent

Search the UK statute book (legislation.gov.uk) for Acts of Parliament, Statutory Instruments, and other UK legislation by title keywords, type, and year. Returns matching legislation items with title, type (e.g. UK Public General Act), year, chapter number, description/long title, enactment date, subject categories, and direct URL to the full text. Supports all UK jurisdictions: England, Wales, Scotland (Scottish Parliament Acts), and Northern Ireland. Common types: ukpga (UK Public General Acts — major Acts of Parliament), uksi (UK Statutory Instruments), asp (Acts of the Scottish Parliament), asc (Acts of Senedd Cymru), nia (Northern Ireland Assembly Acts). Results are paginated (20 per page). Use page parameter to navigate. Data source: legislation.gov.uk — The National Archives, Open Government Licence v3.0, no auth required.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageNoPage number for pagination (default 1, 20 results per page).
typeNoLegislation type code. Common values: ukpga (UK Public General Acts), uksi (UK Statutory Instruments), asp (Scottish Parliament Acts), asc (Acts of Senedd Cymru/Wales), nia (Northern Ireland Assembly Acts). Omit to search all types.
yearNoYear the legislation was enacted (e.g. 2008, 2018). Supports years from 1267 to present.
titleNoSearch term for the legislation title (e.g. "climate change", "data protection", "companies"). At least one of title, year, or type should be provided.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
errorNoPresent only when the call failed. Includes error code, message, request_id, and any provider-specific extras.
resultNoTool response payload. Shape varies per tool — consult the tool description and inputSchema. May be an object, array, string, or number depending on the upstream provider response.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, and destructiveHint=false, covering the safety profile. The description adds valuable context beyond annotations: it states no authentication is required, cites the data source (legislation.gov.uk, The National Archives) and licensing (Open Government Licence v3.0), and discloses pagination behavior (20 results per page). This enhances transparency beyond the structured fields.

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

Conciseness4/5

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

The description is well-structured and front-loaded with the search purpose, followed by returns, jurisdictions, type codes, pagination, and data source. Every sentence delivers relevant information without fluff. It is slightly long given the amount of technical detail, but each component earns its place, making it concise relative to its content.

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 is remarkably complete for a search tool: it specifies the search scope, returned fields, supported jurisdictions, common type codes, pagination behavior, data source, licensing, and authentication requirements. An agent has all necessary information to invoke the tool correctly and interpret results without ambiguity. No critical operational detail is missing.

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%, with each of the four parameters having descriptions, including the enum values for type and the requirement that at least one of title, year, or type be provided. The description repeats the type explanations and pagination details, adding minimal new meaning beyond the schema. Since the schema does the heavy lifting, a baseline of 3 is appropriate.

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 verb (search), the resource (UK statute book on legislation.gov.uk), and the filtering criteria (title keywords, type, year). It also lists the returned fields (title, type, year, chapter, etc.). The search intent is unambiguous and it differentiates from sibling tools like ukleg.legislation.details, ukleg.legislation.recent, and ukleg.legislation.sections by being the discovery tool.

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

Usage Guidelines4/5

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

The description provides clear context on what the tool does (searches across all UK legislation types) and how to iterate through results (page parameter, 20 per page). It does not explicitly state when to use this versus siblings, but the sibling names (details, recent, sections) make the differentiation obvious, and the tools' distinct purposes are implied by the description. This falls under 'clear context, no exclusions'.

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.