Marketplace
No threads yet
Live

get_uk_contents

legislation.gov.uk

Get the complete table of contents for a specific piece of official UK legislation from http://legislation.gov.uk. Returns the title, description, source metadata, and a flat hierarchy of parts, chapters, crossheadings, sections, regulations, and schedules with depth.

Parameters1
Runs15
Updated10d ago
Operational15 runs · 100% succeeded
30 days agotoday

Playground

Runs on Notte and spends your workspace credits — what comes back is the live response, not a sample.

What is get_uk_contents?

Get the complete table of contents for a specific piece of official UK legislation from http://legislation.gov.uk. Returns the title, description, source metadata, and a flat hierarchy of parts, chapters, crossheadings, sections, regulations, and schedules with depth. It runs on Notte's browser infrastructure and returns structured JSON, so you can call it like any other API — pass legislation_id and get the result back without maintaining a scraper.

Response

{
  "items": [
    {
      "depth": 0,
      "title": "<string>",
      "item_type": "<string>",
      "record_fields": {}
    }
  ],
  "links": [
    {}
  ],
  "title": "<string>",
  "item_count": 0,
  "description": "<string>",
  "legislation_id": "<string>",
  "source_metadata": {},
  "source_attributes": {}
}

Call it

curl --location 'https://us-prod.notte.cc/functions/0432a122-73ae-40f9-a413-b4022b2d50a3/runs/start' \
--header 'x-notte-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--data '{
    "function_id": "0432a122-73ae-40f9-a413-b4022b2d50a3",
    "variables": {
        "legislation_id": "ukpga/2018/12"
    }
}'

Ask an agent

Paste this into Claude Code, Cursor or any MCP client to have an agent call this function for you.

prompt
Use the Anything API MCP server (https://anything.notte.cc/mcp).

Call run(function_id="0432a122-73ae-40f9-a413-b4022b2d50a3") — the "get_uk_contents" function, which get the complete table of contents for a specific piece of official UK legislation from http://legislation.gov.uk. Returns the title, description, source metadata, and a flat hierarchy of parts, chapters, crossheadings, sections, regulations, and schedules with depth..

It takes legislation_id (str). Return the result as structured JSON.