get_legislation_table_of_contents
Retrieve a UK legislation document's hierarchical table of contents, including Parts, Chapters, Sections, headings, and fragment IDs, to locate provisions before fetching a specific fragment.
Instructions
Retrieve the table of contents for a UK legislation document. Returns structured JSON by default (json). Also available: xml, akn, html.
Shows the hierarchical structure (Parts, Chapters, Sections) with headings and fragment IDs for use with get_legislation_fragment.
meta.prospective is true when the response indicates that the document contains provisions not yet in force. It is left out on enacted/made text. Contents entries are marked inconsistently, so its absence doesn't mean there are no prospective provisions.
type, year, and number must be exact. If you're not certain, use search_legislation to confirm — identifiers guessed from general knowledge are often wrong.
Version: use a date (YYYY-MM-DD) for a point-in-time snapshot, or enacted/made/created/adopted for the original version. Do not pass version="prospective"; when metadata lists "prospective", that is the latest version and should be fetched by omitting the version parameter.
See: types://guide, cookbook://point-in-time-version, json://table-of-contents-response
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": "get_legislation_table_of_contents"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| type | Yes | Type of legislation (e.g., ukpga, uksi, asp, ukla) | |
| year | Yes | Year of enactment. A 4-digit calendar year (e.g., 2020) works for all legislation. For pre-1963 Acts, the canonical identifier uses a regnal year in Reign/Number format (e.g., Vict/63, Geo5/26). | |
| format | No | Response format (default: json for structured data, xml for CLML Contents, akn for Akoma Ntoso, html for rendered version) | |
| number | Yes | Legislation number (e.g., 18, 1234) | |
| version | No | Optional: Version to retrieve. Use enacted/made/created/adopted for original version, or YYYY-MM-DD for legislation as it stood on that date. Do not use prospective here; when versions ends with prospective, omit version to fetch that version. | |
| language | No | Optional: Set to "welsh" to retrieve the Welsh-language table of contents for bilingual legislation (e.g. asc, anaw types). Defaults to "english". Non-bilingual legislation ignores this parameter. |