get_legislation_section

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_section for the schema, then POST the same URL with its arguments for the data.

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”. Returns the full text of that section alone, so a specific provision does not cost a whole statute.

Parameters

NameTypeRequiredDescription
typestringyesDocument type, e.g. “ukpga”. One of: ${TYPES}.
yearnumberyesYear, e.g. 2018.
numbernumberyesItem number within that year/type, e.g. 12 for the Data Protection Act 2018.
sectionstringyesSection number, e.g. “5”, “170”, or “5A” for an inserted section.
versionstringnoWhich version of the text: ${VERSION_HELP}
as_atstringnoYYYY-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,
  "section": "5"
}

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_section","arguments":{"type":"ukpga","year":2018,"number":12,"section":"5"}}}'

TypeScript (@pipeworx/sdk)

import { Pipeworx } from '@pipeworx/sdk';
const pipeworx = new Pipeworx();

const result = await pipeworx.call('get_legislation_section', {
  "type": "ukpga",
  "year": 2018,
  "number": 12,
  "section": "5"
});

More examples

{
  "type": "ukpga",
  "year": 2018,
  "number": 12,
  "section": "5",
  "version": "enacted"
}
{
  "type": "ukpga",
  "year": 2018,
  "number": 12,
  "section": "3",
  "as_at": "2019-01-01"
}

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.

Regenerated from source · build September 30, 2026