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 support for large statutes.

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
paramsYesLegislationGetTocInput.

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 declare readOnlyHint and idempotentHint; description adds that large statutes are paginated, how to use the numeric section identifier in a follow-up call, and mentions offset/limit. Does not contradict annotations. Could add error handling details.

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 usage guidance and purpose. Brief yet comprehensive. Slight repetition of pagination details, but overall well-structured and efficient.

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?

Given the sibling tools and complexity (many items, pagination), the description covers purpose, usage guidelines, parameter semantics, output handling, and alternatives. An agent can confidently select and invoke this tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, and the description adds practical context: advises using type from legislation_search results, explains offset/limit for pagination with example (Companies Act 2006), and clarifies how to interpret the output (numeric identifier for legislation_get_section).

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 known Acts/SIs, listing components like parts, chapters, sections, schedules. It distinguishes itself from siblings like legislation_get_section and read_resource.

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?

Explicitly starts with 'USE THIS TOOL WHEN' and provides a clear alternative: 'Alternative: call read_resource(...)'. It explains when to choose this tool over the alternative (when structured response with pagination is needed).

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