Skip to main content
Glama
paulieb89

UK Legal Research MCP Server

Get Legislation Table of Contents

legislation_get_toc
Read-onlyIdempotent

Retrieve the structural table of contents for UK legislation including parts, chapters, sections, and schedules with pagination for large acts.

Instructions

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

Returns structural elements with XML id and title, e.g. 'section-47: Definitions'. AFTER calling, pass the numeric section 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
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).
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.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
typeYesLegislation type code echoed from the request
yearYesYear of enactment echoed from the request
numberYesChapter or SI number echoed from the request
offsetYesOffset applied to the full TOC item list
limitYesPage size applied after offset
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.
has_moreYesTrue if more items remain beyond offset+returned
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').
Behavior4/5

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

Annotations already mark the tool as read-only, idempotent, and open-world. The description adds significant behavioral context: pagination via offset/limit, has_more and total_items, example of large statutes (Companies Act 2006), output format with XML ids and titles, and the workflow to pass numeric section ids to legislation_get_section. No contradictions with annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise (about 150 words) and well-structured: usage instruction first, then output description, pagination details, and alternative tool. Every sentence adds value, with no repetition or fluff.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the presence of an output schema (not shown) and 100% schema coverage, the description is complete for core usage: input parameters, pagination, and cross-tool workflow. It could mention error conditions or prerequisites (e.g., valid type/year/number) but these are minimal gaps.

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 description coverage is 100%, so baseline is 3. The description adds value beyond the schema by explaining the purpose of offset/limit in pagination, providing default and max values, and clarifying that type codes come from search results. It also contextualizes parameters for large statutes.

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 clearly states the tool retrieves the structural table of contents for a known Act or SI, using specific verb 'get' and resource 'table of contents'. It differentiates from siblings like legislation_get_section and read_resource by specifying distinct use cases and output formats.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly says when to use (known Act/SI, want TOC) and provides clear alternatives (read_resource for full TOC string, legislation_get_section for section text). It also explains pagination for large statutes. However, it does not explicitly state when NOT to use the tool, which would strengthen guidance.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/paulieb89/uk-legal-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server