Skip to main content
Glama

Get UK Legislation Details

ukleg.legislation.details
Read-onlyIdempotent

Get detailed metadata and the full table of contents (section list) for a specific piece of UK legislation identified by its type, year, and chapter/number. Returns the title, document type, legislative status (enacted/revised), enactment date, last modification date, territorial extent (E+W+S+N.I. or narrower), paragraph counts, and the complete structured list of parts, chapters, and sections with their numbers, titles, and URLs. Use ukleg.legislation.search to find the correct type, year, and number for an act. Example: type=ukpga, year=2008, number=27 retrieves the Climate Change Act 2008. Example: type=ukpga, year=2018, number=12 retrieves the Data Protection Act 2018. Data source: legislation.gov.uk — The National Archives, Open Government Licence v3.0, no auth required.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
typeYesLegislation type code. Common values: ukpga (UK Public General Acts), uksi (UK Statutory Instruments), asp (Scottish Parliament Acts), asc (Senedd Cymru/Wales Acts), nia (Northern Ireland Acts). Example: ukpga for the Climate Change Act 2008.
yearYesYear the legislation was enacted (e.g. 2008 for Climate Change Act 2008).
numberYesChapter or instrument number of the legislation within the year (e.g. 27 for Climate Change Act 2008 c.27).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
errorNoPresent only when the call failed. Includes error code, message, request_id, and any provider-specific extras.
resultNoTool response payload. Shape varies per tool — consult the tool description and inputSchema. May be an object, array, string, or number depending on the upstream provider response.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnly, openWorld, idempotent, and non-destructive behavior. The description adds meaningful context beyond those: what metadata fields will be returned, that it includes a complete structured table of contents, and that no authentication is required. It also names the data source and licence, which helps the agent assess suitability. It does not cover rate limits or response ordering, but given the annotations the description carries enough behavioral context.

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 the tool's core function and return contents before moving to usage guidance and attribution. It is dense but not bloated; the two examples are repetitive with the schema examples but still concretely illustrate a valid call. The data source/licence sentence is useful but slightly beyond the core behavioral description.

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?

For a read-only, three-parameter tool with a full input schema and an output schema, the description is complete: it explains what the tool returns, how to obtain required identifiers, gives examples, and declares auth/licensing context. The presence of an output schema means detailed return-value documentation is not needed in the description. An agent has everything required to select and invoke this tool correctly.

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 description coverage is 100%, and each parameter already has a clear description and example in the schema. The description's examples mirror the schema examples rather than adding new semantic detail, so it does not compensate or extend beyond what structured input schema already provides. This meets the baseline but does not surpass it.

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 ('Get'), resource ('UK legislation'), and identification method (type/year/number), then enumerates the exact fields returned. It clearly differentiates from ukleg.legislation.search and ukleg.legislation.recent by scope and purpose, even pointing to search as the way to find identifiers. Examples further anchor what the tool does.

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 explicitly instructs the agent to use ukleg.legislation.search to find the correct type, year, and number before calling this tool, which is concrete when-to-use guidance. The two worked examples (Climate Change Act, Data Protection Act) give unambiguous usage patterns. This is as explicit as usage guidance gets for this tool.

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.