get_legislation_text
Pack: legislation-uk · Connect: https://pipeworx.io/mcp (see Connect below for a single-pack URL)
No MCP client? Call it directly: GET https://gateway.pipeworx.io/v1/tools/get_legislation_text for the schema, then POST the same URL with its arguments for the data.
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_legislation_section, which returns just that section.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
type | string | yes | Document type, e.g. “ukpga”. One of: ${TYPES}. |
year | number | yes | Year, e.g. 2018. |
number | number | yes | Item number within that year/type, e.g. 12. |
version | string | no | Which version of the text: ${VERSION_HELP} |
as_at | string | no | YYYY-MM-DD — the law as it stood on this date. Alias for a date “version”; the response states the actual served version date, which may be earlier than this if nothing changed on the exact date given. |
Example call
Arguments
{
"type": "ukpga",
"year": 2018,
"number": 12
}
curl
curl -X POST https://gateway.pipeworx.io/legislation-uk/mcp \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"get_legislation_text","arguments":{"type":"ukpga","year":2018,"number":12}}}'
TypeScript (@pipeworx/sdk)
import { Pipeworx } from '@pipeworx/sdk';
const pipeworx = new Pipeworx();
const result = await pipeworx.call('get_legislation_text', {
"type": "ukpga",
"year": 2018,
"number": 12
});
Connect
Add this to your MCP client config — every tool in the catalog, including this one — or use one-click install buttons:
{
"mcpServers": {
"pipeworx": {
"url": "https://pipeworx.io/mcp"
}
}
}
Connect to just the legislation-uk pack
{
"mcpServers": {
"legislation-uk": {
"url": "https://gateway.pipeworx.io/legislation-uk/mcp"
}
}
}
See Getting Started for client-specific install steps.