Skip to main content
Glama

Get Legislation Text

get_legislation_text
Read-onlyIdempotent

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. Large Acts run to megabytes, so this reads a bounded amount and says plainly when it stopped short rather than returning a silently clipped statute. UK law exists in VERSIONS that 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"). 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.

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.
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. Changed1 schema field changed
    • 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.8/5.0
Behavior5/5

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

Annotations already declare a safe, idempotent read, so the bar is lower, yet the description adds substantial non-obvious behavior: output is bounded rather than megabytes, truncation is disclosed rather than silently clipped, and the backing service serves the nearest earlier version rather than erroring. It also names the response field (version_valid_from) that reconciles requested vs. served version.

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?

Purpose and the primary sibling distinction are front-loaded, and the paragraphs are information-dense with no filler. It is on the long side for a 5-parameter read tool, and the version/as_at explanation is somewhat repetitive against the schema, costing a point.

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?

Although there is no output schema, the description covers the key return semantics an agent needs: bounded-length behavior, truncation signaling, and the version_valid_from field. Combined with the source attribution and the versioning caveat, nothing needed to call or interpret this tool is missing.

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 baseline is 3, but the description consolidates and reinforces the versioning model across parameters — the 'current' default, the 'enacted' option, the YYYY-MM-DD date form, and the as_at alias — which helps interpret the two overlapping version parameters together. It largely restates the schema's per-parameter text, hence 4 rather than 5.

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?

First sentence names a specific verb and resource ('Read the text of a whole UK Act or statutory instrument') and immediately frames it against the catalogue-entry sibling. It goes on to distinguish itself from get_legislation_section for single provisions, so an agent can route without opening any schema.

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?

Explicitly states when to use it ('short instruments', 'reading an Act end to end') and when not to ('for one provision prefer get_legislation_section'). The alternative and the condition that selects it are both named, leaving nothing to inference.

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.