Skip to main content
Glama

uk-legislation-mcp-server

Search UK legislation

uklaw_search_legislation
Read-onlyIdempotent

Search the UK statute book on legislation.gov.uk by full text or title, or list legislation by type and year, filtered by geographical extent and point in time. Full-text search ranks by relevance; title searches and type/year listings run newest year first and carry type and year counts (facets) to narrow with. Each result gives the item path to pass to uklaw_get_document. For a known citation or short title, uklaw_lookup_citation is cheaper and exact.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageNoPage number (1–10,000).
textNoFull-text query. Supports AND/OR, "quoted phrases", and stemming. Omit for a title search or a listing.
yearNoCalendar year (also for pre-1963 Acts numbered by regnal year). Not combinable with year_from/year_to.
as_ofNoPoint in time YYYY-MM-DD: only legislation as it stood on that date (items not yet enacted or made are excluded). Omit for current law. Cannot combine with extent.
limitNoResults per page (1–50).
titleNoWords that must all occur in the title. For a known short title or citation, uklaw_lookup_citation is exact.
typesNoType codes (ukpga, uksi, asp, eur, …) and/or groups (all, primary, secondary, eu-origin, draft). "all" covers UK and EU-origin legislation, excluding drafts, and absorbs any other value. uklaw_list_reference topic types lists the codes.
extentNoGeographical extent: england, wales, scotland, ni. An item matches when one of its provisions extends there. Cannot combine with as_of. legislation.gov.uk has not recorded provision-level extent for many recent items, so an empty result does not prove nothing extends there.
year_toNoLatest calendar year of a range; the other bound may be omitted.
year_fromNoEarliest calendar year of a range; the other bound may be omitted.
extent_matchNoUsed only with extent. applicable: a provision extends to any given extent; exact: a provision extends to exactly that set.applicable

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
capNoPage size that capped the list.
pageNoPage returned.
errorNoPresent when the call failed. Absent on success.
limitNoPage size applied.
scopeNoThe scope applied, defaults included.
shownNoResults on this page.
totalNoTotal matches; present only when legislation.gov.uk reports it (often absent on large result sets).
facetsNoType and year counts — title searches and listings only; absent on full-text searches and on a page past the last page.
noticeNoGuidance when nothing matched, or how to fetch the next page.
resultsNoMatching items on this page.
has_moreNoTrue when a further page exists (call again with page + 1).
truncatedNoTrue when more results exist beyond this page.
attributionNoAttribution lines the returned content requires (OGL always; EU and Westlaw credits when applicable).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

Score is being calculated.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.