Skip to main content
Glama
paulieb89

UK Legal Research MCP Server

Get Legislation Table of Contents

legislation_get_toc
Read-onlyIdempotent

Retrieve structured table of contents for UK legislation, enabling navigation through Acts and Statutory Instruments with pagination support for large documents.

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').
Behavior4/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, idempotentHint=true, and openWorldHint=true, covering safety and idempotency. The description adds valuable behavioral context beyond annotations: it explains pagination for large statutes, mentions the response includes has_more and total_items, and provides usage tips for calling legislation_get_section. However, it doesn't detail error conditions or performance aspects like rate limits.

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 well-structured and front-loaded with the core purpose, followed by usage details and alternatives. Every sentence adds value: the first states what it does, the second explains output format and usage for another tool, the third covers pagination, and the fourth clarifies when to use this vs. the alternative. No wasted words.

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 complexity (pagination, alternative methods), rich annotations, and existence of an output schema, the description is complete. It covers purpose, usage guidelines, behavioral traits like pagination, and contextual alternatives, providing all necessary information for an agent to use the tool effectively without needing to infer missing details.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already fully documents all parameters. The description adds some context by mentioning that large statutes like Companies Act 2006 use offset/limit for pagination, which reinforces schema details but doesn't provide new semantic meaning beyond what's in the schema descriptions. This meets the baseline for high schema coverage.

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 verb 'Retrieve' and resource 'table of contents for a UK Act or SI', specifying it returns structural elements with XML id and title. It distinguishes from the alternative resource template approach, making the purpose specific and differentiated from potential alternatives.

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?

The description explicitly provides when to use this tool vs. the alternative (resource template), stating 'Use this tool when you need the structured `LegislationTOC` response with offset/limit/has_more for stepping through Companies-Act-scale lists.' It also mentions when to use the alternative for different needs, offering clear 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