Skip to main content
Glama
UK Business Tools - Ledgerhall

UK Business Tools - Ledgerhall

Get Legislation Table of Contents

law_legislation_get_toc
Read-onlyIdempotent

Fetch the structural table of contents—parts, chapters, sections, or regulations—for a known UK Act or SI, returning XML ids and titles in document order with offset/limit pagination.

Instructions

USE THIS TOOL WHEN you have a known Act / SI and want the structural table of contents (parts, chapters, individual sections/regulations/articles).

Returns XML ids and titles in document order, including Parts, chapters, crossheadings, and provisions; a rare untitled provision is retained as its bare id. Results are paginated with offset/limit.

AFTER calling, pass a provision's bare number (for example 47, not section-47) to legislation_get_section. Check has_more and total_items for large statutes. Use read_resource with the legislation:// toc URI for the full raw listing.

Source: legislation.gov.uk CLML table of contents.

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": {
      "type": "<type>",
      "year": "<year>",
      "number": "<number>"
    },
    "name": "law_legislation_get_toc"
  }
}

Input Schema

NameRequiredDescriptionDefault
typeYeslegislation.gov.uk type code, e.g. 'ukpga' (UK Acts), 'uksi' (UK SIs), 'asp' (Scottish Acts), 'ssi' (Scottish SIs), 'nia' (NI Acts), 'wsi' (Welsh SIs), 'eur' (retained EU regulations). Not 'act' or 'si'. Use the value from legislation_search results.
yearYesYear of enactment
limitNoMaximum items to return in this call (default 200, max 1000). Raise only when you need a larger slice in one response. Check has_more and total_items to know if further pages exist.
numberYesChapter or SI number
offsetNoNumber of items to skip from the flattened TOC. Use with limit to page through very large statutes like the Companies Act 2006 (1300+ items).

Output Schema

NameRequiredDescriptionDefault
typeYesLegislation type code echoed from the request
yearYesYear of enactment echoed from the request
itemsNoTOC entries in XML document order, formatted as '<id>: <title>', e.g. 'section-47: Definitions'. When calling legislation_get_section pass only the numeric part ('47', not 'section-47').
limitYesPage size applied after offset
numberYesChapter or SI number echoed from the request
offsetYesOffset applied to the full TOC item list
has_moreYesTrue if more items remain beyond offset+returned
returnedYesNumber of items in this response
total_itemsYesTotal structural items parsed from the XML, before offset/limit. Compare to `returned` and `has_more` to decide whether to paginate.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv0.4.1
    • changedInput schema / properties / type / description
      Previous value: -"Legislation type code: 'ukpga' (Acts), 'uksi' (SIs), 'asp' (Scottish Acts), 'nia' (NI Acts). Use the value from legislation_search results."New value: +"legislation.gov.uk type code, e.g. 'ukpga' (UK Acts), 'uksi' (UK SIs), 'asp' (Scottish Acts), 'ssi' (Scottish SIs), 'nia' (NI Acts), 'wsi' (Welsh SIs), 'eur' (retained EU regulations). Not 'act' or 'si'. Use the value from legislation_search results."
    • addedInput schema / properties / type / enum
      Added value: +[
      +  "ukpga",
      +  "ukla",
      +  "ukppa",
      +  "gbla",
      +  "apgb",
      +  "gbppa",
      +  "aep",
      +  "aosp",
      +  "asp",
      +  "aip",
      +  "apni",
      +  "mnia",
      +  "nia",
      +  "ukcm",
      +  "mwa",
      +  "anaw",
      +  "asc",
      +  "uksi",
      +  "ssi",
      +  "wsi",
      +  "nisr",
      +  "ukci",
      +  "nisi",
      +  "ukmo",
      +  "nisro",
      +  "ukdsi",
      +  "sdsi",
      +  "nidsr",
      +  "nidsi",
      +  "wdsi",
      +  "eur",
      +  "eudr",
      +  "eudn"
      +]
    • removedInput schema / properties / type / maxLength
      Removed value: -10
    • removedInput schema / properties / type / minLength
      Removed value: -2
  2. First observedv0.2.1

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint/idempotentHint/openWorldHint, so safety is covered; the description still adds real behavior: document-order output, retention of untitled provisions as bare ids, and pagination via offset/limit with has_more and total_items. Slightly reduced because an output schema exists and some of these return-shape details are therefore partly redundant.

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 trigger condition, followed by return shape, then follow-on instructions — a sensible ordering with no filler sentences. Minor waste in re-explaining offset/limit behavior that the parameter descriptions already carry.

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 paginated lookup tool with a full input schema and an output schema, the description covers the trigger, the return shape, the pagination controls, and the handoff to the next tool. An agent has everything needed to call it correctly and act on the result.

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 the enum for 'type' is fully documented in the schema, so the description mostly restates existing meaning. It adds practical color for offset/limit ('page through very large statutes like the Companies Act 2006') but no syntax or format detail the schema lacks, which is the baseline-3 case.

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 opening clause names a specific verb and resource ('structural table of contents' for a known 'Act / SI') and explicitly scopes what is returned (parts, chapters, crossheadings, provisions). An agent can distinguish this from law_legislation_search or law_legislation_get_section 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?

It gives an explicit entry condition ('WHEN you have a known Act / SI'), names the follow-on tool with the exact argument format ('pass a provision's bare number ... to legislation_get_section'), and names an alternative path ('Use read_resource with the legislation:// toc URI for the full raw listing'). Nothing about routing is left to inference.

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

Deploy Server

Other Tools