Get Legislation Table of Contents
legislation_get_tocUSE 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": "legislation_get_toc"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| type | Yes | 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. | |
| year | Yes | Year of enactment | |
| limit | No | Maximum 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. | |
| number | Yes | Chapter or SI number | |
| offset | No | Number 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
| Name | Required | Description | Default |
|---|---|---|---|
| type | Yes | Legislation type code echoed from the request | |
| year | Yes | Year of enactment echoed from the request | |
| items | No | TOC 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'). | |
| limit | Yes | Page size applied after offset | |
| number | Yes | Chapter or SI number echoed from the request | |
| offset | Yes | Offset applied to the full TOC item list | |
| has_more | Yes | True if more items remain beyond offset+returned | |
| returned | Yes | Number of items in this response | |
| total_items | Yes | Total structural items parsed from the XML, before offset/limit. Compare to `returned` and `has_more` to decide whether to paginate. |