UK Legal Research with Lex API
You have access to the complete corpus of UK legislation from The National Archives via MCP tools. This skill teaches you how to conduct thorough legal research — not just which tools exist, but how to use them together effectively.
Research Workflows
Different questions need different approaches. Choose the right workflow for the task.
"What law covers X?" — Topic Research
When the user asks about a legal topic (e.g. "unfair dismissal", "data protection for AI"):
- Search for Acts first using
search_for_legislation_actswith a natural language query. Setinclude_text: falsefor speed — you only need titles and IDs at this stage. - Drill into sections using
search_for_legislation_sectionsfor each relevant Act found. Pass thelegislation_idto scope your search. This is where the substantive law lives. Useinclude_text: truewhen you need to verify a result is genuinely relevant — title matches can be misleading for generic section titles like "Interpretation" or "Extent". - Check amendments using
search_amendmentson key Acts — legislation may have been significantly amended or even partially repealed since enactment. This is easy to miss and important. - Read explanatory notes using
get_explanatory_note_by_legislationorget_explanatory_note_by_sectionto understand Parliament's intent. Not all Acts have explanatory notes — they're generally available for post-1999 legislation, but even some recent Acts lack them. - Try multiple search phrasings for broad topics. Semantic search activates different results for different phrasings — "employment tribunal dismissal" and "unfair dismissal workplace rights" may surface different Acts. Cast a wide net rather than relying on a single query.
The goal is to present a complete picture: what the law says, how it has changed, and what Parliament intended.
"What does section X of Y say?" — Specific Lookup
When the user asks about a specific provision:
- Look up the Act using
lookup_legislationwithlegislation_type,year, andnumber. - Get the section using
search_for_legislation_sectionswith thelegislation_idand an empty query to retrieve by filter. - Check amendments to that section using
search_amendment_sectionswith theprovision_id(e.g. "ukpga/1998/42/section/3"), then alsosearch_amendmentsat the Act level. Section-level search finds textual amendments; Act-level search catches disapplications by later Acts. Both are needed for a complete picture. - Get the explanatory note using
get_explanatory_note_by_sectionfor context on what the provision means.
"How has X been amended?" — Amendment Research
When the user asks about changes to legislation:
- For section-level amendments: use
search_amendment_sectionswith theprovision_id(e.g. "ukpga/1998/42/section/3"). The provision_id must include the section path, not just the Act ID. - Always also check Act-level amendments: use
search_amendmentswith thelegislation_id. This catches amendments that section-level search may miss — particularly disapplications, where a later Act limits where the provision applies without changing its text. Disapplications are enacted by other Acts and may not appear in section-level amendment results. - If both return nothing, search for referencing legislation: use
search_for_legislation_sectionswith a query like "amends [Act name]" or "section [N] [Act name]". Other Acts may reference or modify the provision's effect without being recorded as formal amendments. This fallback is particularly important for pre-2001 legislation, where structured amendment data is sparse. - Distinguish amendment types: textual amendments change the wording; disapplications limit where the provision applies without changing its text; repeals remove it entirely. Disapplications are easy to miss because the original text looks unchanged — always check for them explicitly.
"What was the intent behind X?" — Parliamentary Intent
- Get explanatory notes using
get_explanatory_note_by_legislationfor an overview of the whole Act, orget_explanatory_note_by_sectionfor a specific provision. - Search notes by topic using
search_explanatory_notewith a natural language query if you don't know which Act is relevant. - Filter by note type: use
note_typeto focus on specific sections of the explanatory material (overview, policy_background, legal_background, extent, provisions, commencement, related_documents).
Historical Legislation (pre-1900)
The database contains ~85,000 Acts from 1267 onwards, including major public general Acts. When researching historical legislation:
- Use year filters:
year_fromandyear_towork reliably across the full date range. Use them to narrow results to the relevant period. - Expect different structure: Pre-1963 legislation was ingested from PDFs, so section numbering and titles may be inconsistent. The text is there but may lack the clean structure of modern Acts.
- Try both Act and section search: Historical Acts are discoverable via semantic search. If Act-level search finds something relevant, drill into sections with
search_for_legislation_sectionsusing thelegislation_idandinclude_text: trueto read the actual provisions. - Regnal year citations: Pre-1963 legislation uses regnal year URIs (e.g.
ukpga/Vict/8-9/20for 8 & 9 Vict. c. 20). These work aslegislation_idvalues in all tools. - Amendment data will be sparse: Structured amendment records largely begin from ~2002. For historical Acts, use the referencing search fallback (search section text for "amends [Act name]") rather than relying on amendment tools.
Common Mistakes to Avoid
- Searching Acts when you need sections:
search_for_legislation_actsreturns whole Acts ranked by relevance. If the user wants specific provisions, usesearch_for_legislation_sectionsinstead — or use Acts search first, then sections search to drill in. - Not checking amendments: Always check amendments for key provisions. Legislation from even a few years ago may have been substantially changed.
- Only checking section-level amendments:
search_amendment_sectionsfinds direct textual amendments but can miss disapplications enacted by other Acts. Always also runsearch_amendmentsat the Act level — this is how you find provisions like the Victims and Prisoners Act 2024 disapplying HRA s.3 in specific contexts. - Repeating the same search: If a search returns poor results, try different terms rather than the same query again. The search is semantic — rephrase your query to explore different parts of the embedding space.
- Trusting title matches blindly: A result with a high relevance score may match on title only. Use
include_text: trueand read the actual provision before citing it — especially for sections with generic titles. - Forgetting explanatory notes: When the user asks "why" or "what was the intent", explanatory notes are the answer. They're published by the government alongside the Act and explain the purpose of each provision. Not every Act has them, but when available they're invaluable.
- Using full URLs as IDs: Use short form IDs like "ukpga/1998/42", not "http://www.legislation.gov.uk/id/ukpga/1998/42".
Tool Reference
Legislation Search
search_for_legislation_acts— find Acts/SIs by topic. Key params:query,legislation_type,year_from/year_to,include_text,limit.search_for_legislation_sections— find provisions within legislation. Key params:query,legislation_id,legislation_type,legislation_category,year_from/year_to,size,include_text.
Legislation Retrieval
lookup_legislation— get a specific Act by type/year/number.get_legislation_sections— list all sections of an Act bylegislation_id.get_legislation_full_text— complete text. Setinclude_schedules: trueonly if specifically needed.proxy_legislation_data— enriched metadata from legislation.gov.uk.
Explanatory Notes
search_explanatory_note— search note content. Key params:query,legislation_id,note_type,section_type.get_explanatory_note_by_legislation— all notes for an Act.get_explanatory_note_by_section— note for a specific section number.
Amendments
search_amendments— Act-level amendments. Key params:legislation_id,search_amended.search_amendment_sections— section-level amendments. Key params:provision_id,search_amended.
Output Guidelines
When presenting legal research:
- Cite precisely: include Act name, year, section number, and legislation ID.
- Structure by Act: group findings under each relevant Act with clear headings.
- Distinguish current from historical: note if provisions have been amended, repealed, or disapplied.
- Quote sparingly: short quotes from the legislation text are useful; long block quotes are not.
- Include a sources table: list the Acts consulted with their legislation IDs at the end.
Data Coverage
- Legislation: ~85,000 Acts from 1267–present. Complete structured coverage from 1963; pre-1963 from PDF extraction. 99.8% of sections have year metadata enabling year-filtered search across the full range.
- Explanatory Notes: Generally available for post-1999 legislation, though not every Act has them. Pre-1999 Acts have no explanatory notes in any digital source.
- Amendments: Comprehensive from ~2002 onwards (892,000+ records). Pre-2001 amendment data is sparse — this is a source limitation from legislation.gov.uk, not a gap in Lex. For older legislation, search section text for referencing Acts as a fallback.
- Sources: The National Archives / legislation.gov.uk. All content is verbatim from the source — the API does not summarise or modify legislation text.