Skip to main content
Glama
paulieb89

UK Business Tools - Ledgerhall

by paulieb89

Get Legislation Table of Contents

law_legislation_get_toc
Read-onlyIdempotent

Retrieve the structural table of contents for a UK Act or Statutory Instrument, listing parts, chapters, and individual provisions with XML IDs. Use pagination to navigate large statutes before fetching full sections.

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 structural elements with XML id and title, in document order, e.g. 'section-47: Definitions' for an Act or 'regulation-4: Maximum weekly working time' for an SI. Individual provisions are listed alongside their enclosing Part/Chapter/crossheading headings — both levels matter: the heading entries give you the document's shape, the provision entries give you what to pass to legislation_get_section. A provision with no heading in the source (rare) is listed as a bare id with no title. AFTER calling, pass the numeric identifier (use '47', NOT 'section-47') into legislation_get_section for full text.

Large statutes (Companies Act 2006 has many hundreds of items) are paginated via offset/limit. Check has_more and total_items.

Alternative: call read_resource(uri="legislation://{type}/{year}/{number}/ toc") for the full TOC as a newline-separated id: title string (no pagination). Use this tool when you need the structured response with offset / limit / has_more for stepping through large statutes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
typeYesLegislation type code: 'ukpga' (Acts), 'uksi' (SIs), 'asp' (Scottish Acts), 'nia' (NI Acts). 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

TableJSON 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. First observedv0.2.1

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnly, idempotent, non-destructive, open-world), so the bar is lower, yet the description adds real behavior: large statutes are paginated, check has_more/total_items, and items with no heading are returned as bare ids. It stops short of describing ordering guarantees or error behavior on bad type/number, so a 4 rather than a 5.

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-loads the trigger and output shape before pagination and the alternative, and every sentence carries information (id formats, heading pairing, pagination, alternative). It is longer than strictly necessary — the paragraph format could be tightened — but there is no 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?

For a 5-parameter paginated lookup with an output schema already present, the description covers the remaining gaps: what the structure looks like, the id format to feed downstream, pagination controls, the rare titleless-entry edge case, and the competing read_resource route. Nothing an agent needs to call it correctly 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 the baseline is 3, but the description adds a non-obvious cross-tool parameter convention: the numeric identifier ('47', NOT 'section-47') is what must be passed onward, which the schema does not express. Offset/limit are described in the schema itself, so no extra credit there.

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 specific verb and resource (get the structural table of contents for a known Act/SI) and enumerates exactly what comes back (parts, chapters, sections/regulations/articles). It is clearly distinguishable from legislation_get_section and read_resource, both of which it names.

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?

Opens with an explicit trigger ('USE THIS TOOL WHEN you have a known Act / SI') and names the alternative path (read_resource with the toc URI) along with the condition that selects it — needing structured offset/limit/has_more stepping. It also states the downstream step (pass the numeric id into legislation_get_section).

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