Skip to main content
Glama

Read UK legislation text

uklaw_get_document
Read-onlyIdempotent

Read 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.

Input Schema

NameRequiredDescriptionDefault
itemYesItem 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.
versionNocurrent (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.
languageNoen, 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.
provisionNoProvision 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_textNoItem 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_offsetNoWhere 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

NameRequiredDescriptionDefault
itemNoThe item read.
kindNofull: text returned; outline: a list of provisions to read instead; pdf_only: the item is held as PDF only (see links.pdf).
textNoThe 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.
errorNoPresent when the call failed. Absent on success.
linksNoLinks to the document.
noticeNoNotices: 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.
outlineNoProvisions to read next, present when kind is outline: up to 100 entries from outline_offset; empty when outline_offset is past the end.
versionNoVersion requested and served.
languageNoLanguage actually served (en or cy).
editorialNoEditorial status — read before relying on revised text.
provisionNoThe provision read — present for provision-level reads.
annotationsNoAnnotations 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.
attributionNoAttribution lines the returned content requires (OGL always; EU and Westlaw credits when applicable).
outline_noticeNoHow to read a provision from the outline, naming one to start with; past the outline’s end, its entry count.
unapplied_effectsNoRecorded 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.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed8 schema fields changed
    • changedInput schema / properties / item / description
      Previous value: -"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."New value: +"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."
    • changedInput schema / properties / version / description
      Previous value: -"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, 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."New value: +"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."
    • changedOutput schema / properties / editorial / properties / outstanding_effects / description
      Previous value: -"Effects requiring a text change not yet applied that touch this provision, or at item level every such effect on the item: the full count, beyond the 20 unapplied_effects lists."New value: +"Effects requiring a text change not yet applied: at provision level those touching the provision, an element enclosing it (Part, Chapter, cross-heading) or a provision inside it; at item level every such effect on the item. The full count, beyond the 20 unapplied_effects lists and the effects inside an outlined provision, which it does not list."
    • changedOutput schema / properties / error / properties / data / properties / reason / description
      Previous value: -"Machine-readable failure mode. Declared by this tool: `invalid_item`: item is not a full {type}/{year}/{number} item path or legislation.gov.uk URI, its type code is unknown, or a URI carries an unreadable provision. `invalid_provision`: provision cannot be normalized, or conflicts with a provision embedded in item. `invalid_version`: version is shaped YYYY-MM-DD but is not a real calendar date, or a URI carried an unsupported version. `match_text_needs_item_level`: match_text is combined with provision. `document_not_found`: legislation.gov.uk has no such item, or the identifier check that would tell a missing item from a missing provision could not run in time. `provision_not_found`: The item exists but has no document at that provision path and version. `version_not_found`: Item level: the item exists but has no version at the requested date (the date precedes it). `upstream_refused`: legislation.gov.uk answered 403 or 429 (its fair use rate limit or a block). `pacer_shed`: The shared request queue cannot start this call within its deadline. Other values are possible when a failure originates below the handler."New value: +"Machine-readable failure mode. Declared by this tool: `invalid_item`: item is not a full {type}/{year}/{number} item path or legislation.gov.uk URI, its type code is unknown, or a URI carries an unreadable provision. `invalid_provision`: provision cannot be normalized, or conflicts with a provision embedded in item. `invalid_version`: version is shaped YYYY-MM-DD but is not a real calendar date, or a URI carried an unsupported version. `ambiguous_item`: item names more than one item on legislation.gov.uk (a 300), as a pre-1963 calendar year and chapter shared by two parliamentary sessions does: ukpga/1955/19. `match_text_needs_item_level`: match_text is combined with provision. `document_not_found`: legislation.gov.uk has no such item, or the identifier check that would tell a missing item from a missing provision could not run in time. `provision_not_found`: The item exists but has no document at that provision path and version. `version_not_found`: Item level: the item exists but has no version at the requested date (the date precedes it). `upstream_refused`: legislation.gov.uk answered 403 or 429 (its fair use rate limit or a block). `pacer_shed`: The shared request queue cannot start this call within its deadline. Other values are possible when a failure originates below the handler."
    • changedOutput schema / properties / error / properties / data / properties / reason / examples
      Previous value: -[
      -  "invalid_item",
      -  "invalid_provision",
      -  "invalid_version",
      -  "match_text_needs_item_level",
      -  "document_not_found",
      -  "provision_not_found",
      -  "version_not_found",
      -  "upstream_refused",
      -  "pacer_shed"
      -]New value: +[
      +  "invalid_item",
      +  "invalid_provision",
      +  "invalid_version",
      +  "ambiguous_item",
      +  "match_text_needs_item_level",
      +  "document_not_found",
      +  "provision_not_found",
      +  "version_not_found",
      +  "upstream_refused",
      +  "pacer_shed"
      +]
    • changedOutput schema / properties / item / properties / path / description
      Previous value: -"Item path, e.g. ukpga/2018/12."New value: +"Item path legislation.gov.uk serves the item at, e.g. ukpga/2018/12; a redirected input (ukpga/1925/20 → ukpga/Geo5/15-16/20) reports the served path, with a notice."
    • changedOutput schema / properties / notice / description
      Previous value: -"Notices: Welsh fallback, original text served for a dated read, an omitted provision window, the unapplied effects an item outline leaves out, 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."New value: +"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."
    • changedOutput schema / properties / unapplied_effects / description
      Previous value: -"Recorded effects not yet applied to the revised text that touch this provision (at item level, the item’s): the first 20, outstanding first, with a notice when more exist; empty when none. Absent on an item-level outline, where a notice gives the item’s count and uklaw_get_amendments lists them."New value: +"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."
  2. First observed

TDQS

A4.6/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already cover read-only, idempotent, open-world behavior. The description adds substantial context beyond annotations: editorial status, applied amendment history, unapplied effects, available versions, attribution, caveats about revised text lagging, and the fallback behavior for dates outside revised coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with purpose and then layers in usage guidelines and caveats without wasted words. It is dense and information-rich, though the long opening sentence and several sub-clauses make it slightly harder to scan than ideal.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With an output schema present and rich annotations, the description still covers the key behavioral nuances an agent needs: the primary read path, item-level fallback behavior, version semantics, caveats about revised text, and the existence of a sibling tool for amendments. Nothing essential is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the schema already documents all six parameters in detail. The description does not add syntax or format details beyond what the schema provides; its parameter-related notes (e.g., match_text at item level, version behavior) largely restate schema content. The baseline of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb (Read) and resource (UK legislation item or provision) with its scope and formats. It explicitly distinguishes provision-level reads as the main path versus item-level reads as an outline for larger items, and names uklaw_get_amendments as the sibling for amendment history.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives explicit when-to-use guidance: provision-level reads are primary, item-level reads return whole text only for small items and otherwise an outline, and match_text is item-level only. It also directs agents to read editorial.caveat and unapplied_effects before relying on revised text, and to use uklaw_get_amendments for every recorded effect.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.