Skip to main content
Glama

Get Legislation Section

get_legislation_section
Read-onlyIdempotent

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. Identify the legislation by type + year + number (Data Protection Act 2018 = ukpga/2018/12) and give the section number. UK law exists in VERSIONS and they differ in substance: pass version to choose "current" (default — the law as amended and in force today), "enacted" (the original text as passed), or a date YYYY-MM-DD for the text as it stood on that day. as_at is an alias for a date version (e.g. as_at: "2019-01-01") — the same date is also accepted via version. legislation.gov.uk serves the NEAREST EARLIER version for a date with no amendment on it rather than erroring, so every response states the version it actually served (version_valid_from) alongside the date asked for, even when they differ. Source: legislation.gov.uk, the official database. Use search_uk_legislation or get_legislation first if you need the year and number.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
typeYesDocument type, e.g. "ukpga". One of: ukpga (UK Public General Acts), uksi (UK Statutory Instruments), asp (Scottish Parliament Acts), anaw/asc (Wales), nia (Northern Ireland), ukla (UK Local Acts).
yearYesYear, e.g. 2018.
as_atNoYYYY-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.
numberYesItem number within that year/type, e.g. 12 for the Data Protection Act 2018.
sectionYesSection number, e.g. "5", "170", or "5A" for an inserted section.
versionNoWhich version of the text: "current" (default — the law as amended and in force today), "enacted" (the original text as passed), or a date YYYY-MM-DD for the text as it stood on that day.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • changedInput schema / examples
      Previous value: -[
      -  {
      -    "number": 12,
      -    "section": "5",
      -    "type": "ukpga",
      -    "year": 2018
      -  },
      -  {
      -    "number": 12,
      -    "section": "5",
      -    "type": "ukpga",
      -    "version": "enacted",
      -    "year": 2018
      -  }
      -]New value: +[
      +  {
      +    "number": 12,
      +    "section": "5",
      +    "type": "ukpga",
      +    "year": 2018
      +  },
      +  {
      +    "number": 12,
      +    "section": "5",
      +    "type": "ukpga",
      +    "version": "enacted",
      +    "year": 2018
      +  },
      +  {
      +    "as_at": "2019-01-01",
      +    "number": 12,
      +    "section": "3",
      +    "type": "ukpga",
      +    "year": 2018
      +  }
      +]
    • addedInput schema / properties / as_at
      Added value: +{
      +  "description": "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.",
      +  "type": "string"
      +}
  2. Added

TDQS

A4.6/5.0
Behavior5/5

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

Annotations only cover the read-only/idempotent safety profile; the description adds substantial behavior beyond that — the nearest-earlier-version fallback rather than erroring, the fact that the served version is reported via version_valid_from even when it differs from the requested date, and the source database. These are exactly the operational traits an agent needs.

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?

Front-loaded with the core idea and example citations, then detail on versioning. It is long and repeats some version/as_at material already in the schema, but no sentence is pure filler.

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?

No output schema exists, yet the description covers the return payload (the section's text plus the actually-served version via version_valid_from) and the source. For a 6-param read tool this is complete enough to invoke correctly.

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

Parameters4/5

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

Schema coverage is 100% so the baseline is 3, but the description goes further by showing how a real citation maps to params ('Data Protection Act 2018 = ukpga/2018/12') and by clarifying that as_at and a date version are the same thing and that 'current' is the default. That alias/default semantics is genuinely additive.

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?

States a precise verb (read) and resource (one section of a UK Act/SI) with concrete example queries, and the scoping phrase 'the full text of that section alone' distinguishes it from whole-statute siblings like get_legislation. An agent can tell what it does without opening the schema.

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

Usage Guidelines4/5

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

Explicitly routes the agent to search_uk_legislation or get_legislation when the year/number is unknown, and gives clear 'when' for the version parameter. It does not, however, differentiate itself from the very similarly-named sibling get_legislation_text, which is the main remaining ambiguity.

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.