How to Use legislation.gov.uk table of contents in n8n
Returns the headings and numbered provisions that organize an Act or instrument on legislation.gov.uk. Use it to locate relevant sections and schedules before requesting their text.
Prompts to try with legislation.gov.uk table of contents in n8n
Copy an example into n8n, or ask in your own words.
Each Monday, use legislation.gov.uk table of contents for the Procurement Act 2023 and report changes to headings or provision numbers since the previous check.
Every Monday at 9am: scrape https://example.com/pricing with legislation.gov.uk table of contents and turn it into a comparison table.
Crawl the docs at https://docs.example.com with legislation.gov.uk table of contents and summarize each section.
Pull the latest posts from this blog with legislation.gov.uk table of contents and list their titles and dates.
Scrape the job listings at https://example.com/careers with legislation.gov.uk table of contents and give me a CSV.
How to set up legislation.gov.uk table of contents in n8n
Pick the way that suits you. Each takes about two minutes.
Use the Spiral skill
- Send n8n this message
Your agent reads Spiral's skill and sets itself up.
set up https://spiral.ai/SKILL.md
- Sign in or paste a key
Approve Spiral in the browser, or give the agent a key from the console.
Use Spiral's MCP server
- Create a key
Create a key under API keys in the console.
- Add an MCP Client node
In a workflow, add an MCP Client node (or, under an AI Agent node, an MCP Client Tool) and set:
https://api.spiral.ai/mcp
- Pick a tool
The node lists Spiral's tools. In an MCP Client node pick one, such as run, and give it its arguments:
{ "provider": "fal", "model": "fal-ai/flux/schnell", "input": { "prompt": "a lighthouse at dawn" }, "wait": true } - Run legislation.gov.uk table of contents in a workflow step
Give the step an instruction like the ones below and run it on your trigger or schedule. Spiral finds legislation.gov.uk table of contents, prices it and runs it each time the step fires.
Use the Spiral CLI
- Install and sign in
Installs the Spiral CLI, signs you in and adds its skill to your coding agents.
npx -y spiral-cli@latest init
Call the Spiral API
- Create an API key
In the console, under API keys.
- Run legislation.gov.uk table of contents
One request; the result comes back by polling or a webhook.
curl https://api.spiral.ai/v1/runs \ -H "Authorization: Bearer $SPIRAL_API_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: $(uuidgen)" \ -d '{ "provider": "alexandria", "model": "legislation-gov-uk/legislation/get_contents", "input": { "type": "<type>", "year": 1200, "number": 1 } }'
Then paste one of the prompts above: n8n finds legislation.gov.uk table of contents on Spiral, shows the price and runs it.
legislation.gov.uk table of contents providers and prices
Spiral runs legislation.gov.uk table of contents through Alexandria. Open a card for today's price, with every fee included.
Settings you can ask for
Ask n8n for any of these in your prompt.
| Setting | Allowed values | Default | Description |
|---|---|---|---|
| Year | 1200 to 2100 | year | |
| Number | a number from 1 | number |
Every API field of legislation.gov.uk · Get contents is on its tool page: open its card above.
What can you do with legislation.gov.uk table of contents in n8n?
Keep a research watchlist of legislation.gov.uk records for procurement, planning, or privacy work. A scheduled agent can compare retrieved titles, contents, provision wording, or amendment records between runs and report the differences it finds.
Prepare a planning legislation brief
Find legislation about nationally significant infrastructure projects, resolve the cited Acts, map relevant headings, read selected provisions, and review recorded amendments for a planning research brief.
Review privacy policy references
Research legislation cited in a business privacy policy, confirm each identifier, locate relevant sections, collect their wording, and examine amendment records before proposing policy revisions.
Build a procurement research pack
Discover procurement legislation, confirm citations, organize the relevant Parts and schedules, retrieve selected text, and attach recorded changes for a purchasing team's review.
Check a consumer rights explainer
Find the legislation behind an article's claims, establish exact identifiers, locate the cited provisions, compare the article with source wording, and inspect amendment records before publication.
Create a section reading list
Turn an Act's contents into a reading list, then retrieve the selected provisions with their section headings for a training session.
More on legislation.gov.uk table of contents and n8n
Overview
legislation.gov.uk table of contents in other agents
Questions about legislation.gov.uk table of contents in n8n
Can n8n use legislation.gov.uk table of contents?
Yes. Add Spiral to n8n as an MCP server, and n8n can find and run legislation.gov.uk table of contents like any built-in tool.
How much does legislation.gov.uk table of contents cost in n8n?
$0.00873 per call. You pay from your Spiral balance as you go, with no subscription, and a failed run is not charged. Your n8n plan is separate.
Do I need an Alexandria account to use legislation.gov.uk table of contents in n8n?
You need no Alexandria account. n8n uses one Spiral API key for every tool, and Spiral runs legislation.gov.uk table of contents on its own Alexandria account.
How long does it take to set up legislation.gov.uk table of contents in n8n?
About two minutes: create a key, then add an MCP Client node, then pick a tool.
Does n8n wait while legislation.gov.uk table of contents runs?
legislation.gov.uk table of contents runs in the background. n8n starts the run, checks on it and gives you the json when it's ready.
Does legislation.gov.uk contain every UK law?
No. It holds almost all UK primary and secondary legislation published since 1988, plus some earlier legislation, so an unsuccessful search does not establish that a law never existed.
How quickly are amendment records added?
The source says recording effects can take up to six weeks when a document is large or many new laws need analysis. That is the time to record changes, not a guarantee that the revised wording has incorporated them.
Does the latest available text include every amendment?
No. Legislation.gov.uk can have known changes that have not yet been applied to its text, and its XML metadata lists outstanding effects.
How far back does the version history go?
Requests before February 1, 1991, normally redirect to the base-date version; the corresponding base date for Northern Ireland legislation is January 1, 2006. Historical version coverage therefore has a different boundary from the date of the law itself.
Can a subject search match exact phrases?
Yes. Legislation.gov.uk supports phrases and Boolean queries in title and text searches, with uppercase AND and OR acting as operators.
Start using legislation.gov.uk table of contents in n8n
One Spiral account for every tool your agent needs. No subscription; you pay per run.
Paste this into n8n:
set up https://spiral.ai/SKILL.md


