legislation.gov.uk
live LegalGovernmentlegislation.gov.uk — search and retrieve full text and metadata for UK Acts of Parliament and statutory instruments.
Tools
search_legislation Search UK legislation by title words (and optional year), returning matching Acts/instruments with their full-text URLs.
No parameters required.
Try it
get_legislation Get metadata for one specific piece of UK legislation by type + year + number (e.g. ukpga/2010/15 = Equality Act 2010).
No parameters required.
Try it
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
No parameters required.
Try it
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
No parameters required.
Try it
Test with curl
The gateway speaks JSON-RPC 2.0 over HTTP POST. You can test any pack directly from the terminal.
curl -X POST https://gateway.pipeworx.io/legislation-uk/mcp \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' curl -X POST https://gateway.pipeworx.io/legislation-uk/mcp \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"search_legislation","arguments":{}}}' Use with the SDK
Install @pipeworx/sdk to call tools from any TypeScript/Node project.
import { Pipeworx } from '@pipeworx/sdk';
const px = new Pipeworx();
const result = await px.call("search_legislation", {}); // Or ask in plain English:
const answer = await px.ask("legislation");