Read UK legislation text
uklaw_get_documentRead one item or one provision of UK legislation from legislation.gov.uk — as it stands now (revised), as enacted/made, or as it stood on a date — in Markdown, with its editorial status, annotations (the applied amendment history), the unapplied effects touching it, the versions available, and attribution. Provision-level reads are the main path; an item-level read returns the whole text only for small items and otherwise an outline of provision paths to read next. With match_text (item level), returns the provisions whose text matches. Revised text is an editorial consolidation that can lag: read editorial.caveat and unapplied_effects before relying on it, and use uklaw_get_amendments for every recorded effect on an item, applied or not.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"item": "<item>"
},
"name": "uklaw_get_document"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| item | Yes | Item path {type}/{year}/{number} — ukpga/2018/12, uksi/2019/419, eur/2016/679, ukpga/Eliz2/3-4/19 — or any legislation.gov.uk URI (a URI carrying a provision, version, or /welsh is split into those parts; a version or /welsh in the URI applies unless the version or language input is set). Get it from uklaw_lookup_citation or uklaw_search_legislation. A path legislation.gov.uk serves at another path — a pre-1963 Act by calendar year (ukpga/1925/20 is ukpga/Geo5/15-16/20), a Welsh SI as uksi — is read there, and item.path reports the served path, with a notice. | |
| version | No | current (the latest revised text, or the original text for an item never revised), enacted (made, adopted and created are synonyms — the original text), or a date YYYY-MM-DD for the text as it stood then. Omitted: the version in an item URI, else current. A future date returns the latest version; a date before the earliest revised version (1991-02-01 for most primary legislation, 2006-01-01 for Northern Ireland) returns that version, with a notice; and a date on or after the made or enactment date of an item never revised returns its original text, with a notice. version.applied reports the version served. | |
| language | No | en, or cy for the Welsh text of Welsh legislation (asc, anaw, mwa, wsi). Omitted: cy when an item URI ends in /welsh, else en. English is returned, with a notice, when no Welsh text exists. | |
| provision | No | Provision path — section/45/2/f, regulation/5, article/28/3, schedule/2/paragraph/3, part/3/chapter/2, introduction — or citation shorthand (s. 45(2)(f), reg. 5, art. 28(3), Sch. 2 para. 3), normalized before the request. Omit to read the item; an item-level outline lists the paths. | |
| match_text | No | Item level only (omit provision): return the outline of provisions whose text contains this term, e.g. "processor" — 100 entries per call; outline_offset reaches the rest. | |
| outline_offset | No | Where a returned outline starts: 0 lists entries 1–100, 100 the next 100. Applies only when kind is outline (ignored when text is returned); a notice names the next offset while entries remain. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| item | No | The item read. | |
| kind | No | full: text returned; outline: a list of provisions to read instead; pdf_only: the item is held as PDF only (see links.pdf). | |
| text | No | The text as Markdown, present when kind is full; amendments are wrapped as [F1 …] keyed to annotations. A provision with no smaller child provisions that renders over 40,000 characters, counting its annotations, is cut to 40,000, and a notice gives its full size and the links to the full text. | |
| error | No | Present when the call failed. Absent on success. | |
| links | No | Links to the document. | |
| notice | No | Notices: the path an item input is served at, Welsh fallback, original text served for a dated read, a later version served for a date before the earliest revised version, an omitted provision window, the unapplied effects an item outline or an outlined provision leaves out, unapplied effects on enclosing or contained provisions that could not be checked, how many effects of a multi-page unapplied changes feed were checked, truncated lists, an outline window with the outline_offset that continues it, an oversized provision with no smaller child provisions returned whole or cut (its full size, and the links to the full text), and how to continue. | |
| outline | No | Provisions to read next, present when kind is outline: up to 100 entries from outline_offset; empty when outline_offset is past the end. | |
| version | No | Version requested and served. | |
| language | No | Language actually served (en or cy). | |
| editorial | No | Editorial status — read before relying on revised text. | |
| provision | No | The provision read — present for provision-level reads. | |
| annotations | No | Annotations referenced by the text, present when kind is full — the applied amendment history of the version served. When the text is cut, only those the kept text references. | |
| attribution | No | Attribution lines the returned content requires (OGL always; EU and Westlaw credits when applicable). | |
| outline_notice | No | How to read a provision from the outline, naming one to start with; past the outline’s end, its entry count. | |
| unapplied_effects | No | Recorded effects not yet applied to the revised text that touch this provision — whole-item effects, those on an element enclosing it (Part, Chapter, cross-heading), and when kind is full those on a provision inside it — or at item level the item’s: the first 20, outstanding first, with a notice when more exist; empty when none. An outlined provision does not list the effects inside it; a notice counts them. Absent on an item-level outline, where a notice gives the item’s count. uklaw_get_amendments with the item (for a pre-1963 Act, its calendar-year path, as the notices name it) and status "unapplied", without provision, lists them all. |