@pipeworx/legislation-uk
Connect: https://gateway.pipeworx.io/legislation-uk/mcp · Install: one-click buttons
Tools: 4
UK legislation from legislation.gov.uk — the official database of UK Acts and statutory instruments. Search for legislation, read its metadata, and read the actual text of an Act or of one section, in the version you choose (as amended, as enacted, or as it stood on a date).
Covers England, Wales, Scotland and Northern Ireland: ukpga (UK Public General Acts), uksi (UK Statutory Instruments), asp (Acts of the Scottish Parliament), anaw/asc (Wales), nia (Northern Ireland Acts), ukla (UK Local Acts).
Tools
| Tool | What it returns |
|---|---|
search_legislation | Search by title words (and optional year) → matching Acts/instruments with full-text URLs |
get_legislation | Metadata for one Act/instrument by type + year + number: title, status, extent, enactment date, full-text URL |
get_legislation_section | The actual text of ONE section — e.g. section 5 of the Data Protection Act 2018 (ukpga/2018/12) — without paying for the whole statute |
get_legislation_text | The text of a whole Act/instrument, byte-bounded: large Acts are truncated with an explicit note pointing at the section-level tool |
Versions (the trap)
UK legislation exists in point-in-time versions that differ in substance, not cosmetics: the text as enacted and the text as amended at a date. Section 5 of the Data Protection Act 2018 refers to “the GDPR” as enacted and “the UK GDPR” as it stands today. The text tools take a version argument — "current" (default), "enacted", or a YYYY-MM-DD date — and every response states which version it served and the date that version took effect. Repealed/omitted words appear as runs of dots, exactly as legislation.gov.uk renders them.
Section numbering also differs between versions: a section inserted by amendment does not exist in the enacted text, so a section_not_found for one version may still exist in another.
Auth
None. legislation.gov.uk is keyless and free.
Data sources
- legislation.gov.uk — full text as CLML XML at
/{type}/{year}/{number}/data.xml, section-level at/{type}/{year}/{number}/section/{n}/data.xml, versioned via/enactedor/{date}path segments; search via the Atom feed at/{type}/data.feed.
Tools
- search_legislation — Search UK legislation by title words (and optional year), returning matching Acts/instruments with their full-text URLs.
- get_legislation — Get metadata for one specific piece of UK legislation by type + year + number (e.g. ukpga/2010/15 = Equality Act 2010).
- get_legislation_section — Read the actual WORDS of one section of a UK Act or statutory instrument — “what does section 5 of the Data Protection Act 2018 say”, “quote section 1 of the Human Rights Act”, “text of s.170 DPA 2018
- get_legislation_text — Read the text of a whole UK Act or statutory instrument — the body of the law rather than a catalogue entry. Use for short instruments and for reading an Act end to end; for one provision prefer get_l
Tools
-
get_legislation— Get metadata for one specific piece of UK legislation by type + year + number (e.g. ukpga/2010/15 = Equality Act 2010). -
get_legislation_section— Read the actual WORDS of one section of a UK Act or statutory instrument — what does section 5 of the Data Protection Act 2018 say , quote section 1 of the Human Rights Act , text of s.170 DPA 2018 . -
get_legislation_text— Read the text of a whole UK Act or statutory instrument — the body of the law rather than a catalogue entry. Use for short instruments and for reading an Act end to end; for one provision prefer get_l -
search_legislation— Search UK legislation by title words (and optional year), returning matching Acts/instruments with their full-text URLs.