Skip to main content
Glama
paulieb89

UK Legal Research MCP Server

Get Legislation Table of Contents

legislation_get_toc
Read-onlyIdempotent

Retrieve the structured table of contents for a UK Act or Statutory Instrument. Returns parts, chapters, sections, and schedules with IDs and titles, with pagination for large statutes.

Instructions

Retrieve the table of contents for a UK Act or SI.

Returns structural elements (parts, chapters, sections, schedules) with XML id and title, e.g. 'section-47: Definitions'. When calling legislation_get_section, pass only the numeric part — use '47', not 'section-47'.

Large statutes (Companies Act 2006 has 1300+ items) are paginated via offset/limit. Check has_more and total_items on the response.

Alternative: read the resource template 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 LegislationTOC response with offset/limit/has_more for stepping through Companies-Act-scale lists.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
paramsYesLegislationGetTocInput with type, year, number, offset, limit.

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 number of structural items parsed from the XML, before offset/limit. Use this to know the full size of the TOC.
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').
Behavior5/5

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

Annotations already cover readOnly, destructive, idempotent, openWorld hints. Description adds pagination behavior, offset/limit details, and format of IDs. No contradictions.

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?

Concise, informative, and well-structured. Front-loads purpose, then provides key details and alternatives. Every sentence adds value.

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 output schema and annotations, description covers purpose, pagination, output usage, and alternative. Complete for the tool's functionality.

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?

Input schema has 100% coverage with descriptions. Description adds context on using offset/limit for large statutes and how to interpret returned IDs, enhancing understanding beyond schema.

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?

Clearly states it retrieves the table of contents for a UK Act or SI, specifies that it returns structural elements with XML id and title, and distinguishes itself from the alternative resource template format.

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 tells when to use this tool over the alternative: when structured response with pagination is needed. Provides guidance on using numeric part of IDs for legislation_get_section.

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