io.github.matematicsolutions/gb-eli-mcp
MCP server for UK legislation (legislation.gov.uk): persistent identifiers and verifiable citations.
Versions
0.1.0latestTools 9
gb_search Search UK legislation on legislation.gov.uk. Maps to the official Atom search feed (``/all/data.feed`` or ``/{doc_type}/data.feed``, optionally with ``?text=...&year=...&page=...``). Each item gets ``eli_uri``, ``human_readable_citation``, ``source_url`` (per Art. 4 CONSTITUTION). Args: query: ``SearchQuery`` - text, doc_type (e.g. 'ukpga', 'uksi', 'asp'), year, page. Returns: ``SearchResult`` with ``total_estimate`` and ``items: list[LegislationInfo]``.
gb_get_act Fetch UK legislation metadata from legislation.gov.uk by reference. Args: reference: a reference like ``"ukpga/2018/12"`` (Data Protection Act 2018), ``"uksi/2019/419"``, ``"asp/2015/1"``, or a full legislation.gov.uk URL. An optional point-in-time date suffix (``/2026-06-19``) selects a specific revised version. Returns: ``Legislation`` with ``eli_uri``, ``human_readable_citation``, ``source_url``.
gb_get_text Fetch the full text of UK legislation. Uses legislation.gov.uk's content-negotiation path suffix (``/data.{format}``) - ``xml`` (the site's own ``legislation.xsd`` schema), ``html``, ``akn`` (Akoma Ntoso), ``rdf``, ``pdf``, or ``csv``. Args: reference: reference of the act/instrument (work or point-in-time expression). format: one of ``"xml"``, ``"html"``, ``"akn"``, ``"rdf"``, ``"pdf"``, ``"csv"``. Returns: ``LegislationText`` with ``eli_uri``, ``human_readable_citation``, ``source_url``, ``content``.
gb_recent_legislation UK legislation published since ``since_iso`` (ISO 8601 date), newest-first. Maps to the Atom search feed sorted/filtered by publication year, optionally scoped to one ``doc_type``. legislation.gov.uk's public search feed does not support a generic ``dateFrom`` filter across all types, so this tool filters the requested year's feed by the ``published`` date client-side. Args: since_iso: a date in ISO 8601 (e.g. ``"2026-01-01"``). Only the year is used to select the feed to scan; items are then filtered to on/after this date. doc_type: restrict to one UK document-type code (e.g. ``"ukpga"``, ``"uksi"``). limit: max items to return (1..100). Returns: List of ``RecentChangeInfo`` enriched with the citation contract, newest-first.
gb_search_case_law Search UK case law on The National Archives' Find Case Law service. Maps to the public Atom feed at ``caselaw.nationalarchives.gov.uk/atom.xml`` (confirmed live 2026-07-06 - keyless, Open Justice Licence). A separate service from legislation.gov.uk: different host, different Atom dialect (``tna:`` namespace). Args: query: full-text search (matches judgment text in order, per upstream docs). court: court/tribunal code, e.g. ``"ewhc/admin"``, ``"ewca/civ"``, ``"uksc"``. Passed through to Find Case Law's own ``court`` query param. from_date: ISO 8601 date (YYYY-MM-DD), inclusive. Find Case Law's public API has no documented server-side date-range filter, so this is applied client-side against each result's ``date`` field after fetching. to_date: ISO 8601 date (YYYY-MM-DD), inclusive. Same client-side caveat. limit: max items to return (1..100). Returns: ``CaseLawSearchResult`` with ``total_estimate`` and ``items: list[CaseLawInfo]``.
gb_get_case Fetch a UK judgment from The National Archives' Find Case Law service. Args: reference: a neutral citation (e.g. ``"[2026] EWHC 1698 (Admin)"``), a Find Case Law URI/path (e.g. ``"ewhc/admin/2026/1698"`` or a full ``caselaw.nationalarchives.gov.uk`` URL), or an opaque ``"d-{uuid}"`` id. Neutral citations resolve directly to a URI only for pre-April-2025 documents (``/{court}/{year}/{number}``); for later documents (opaque id), use `gb_search_case_law` first to find the ``uri``. Returns: ``CaseLawDocument`` with ``human_readable_citation``, ``source_url``, and the Akoma Ntoso XML ``content`` (or a ``pdf_url`` fallback if XML is unavailable).
gb_search_govuk Search GOV.UK documents - tribunal decisions, HMRC manuals, CMA cases and more. Maps to the GOV.UK Search API (``www.gov.uk/api/search.json`` - confirmed live 2026-07-07: keyless, Open Government Licence v3.0). One upstream aggregating many institutions; filter with ``document_type``. Legally weighty types with live-verified totals (2026-07-07): ``employment_tribunal_decision`` (132,162), ``hmrc_manual_section`` (85,315), ``residential_property_tribunal_decision`` (17,088), ``employment_appeal_tribunal_decision`` (2,571), ``cma_case`` (2,565), ``utaac_decision`` (2,031), ``tax_tribunal_decision`` (1,414), ``asylum_support_decision`` (101). Args: query: full-text search terms. document_type: GOV.UK ``content_store_document_type`` slug (see above). organisation: GOV.UK organisation slug, e.g. ``"competition-and-markets-authority"``. from_date: ISO 8601 date (YYYY-MM-DD), inclusive - passed server-side via ``filter_public_timestamp`` (unlike Find Case Law, GOV.UK supports this). to_date: ISO 8601 date (YYYY-MM-DD), inclusive. Same server-side filter. limit: max items to return (1..100). start: result offset for pagination (0-based). Returns: ``GovUkSearchResult`` with the API's own ``total`` and ``items: list[GovUkDocumentInfo]``.
gb_get_govuk_content Fetch one GOV.UK document (tribunal decision, HMRC manual section, CMA case). Maps to the GOV.UK Content API (``www.gov.uk/api/content/{path}`` - confirmed live 2026-07-07). Tribunal decisions carry the judgment as a PDF in ``attachments`` with only a short HTML body; HMRC manual sections carry the full text in ``body_html``. Args: path: the document's site path - take it from a ``gb_search_govuk`` result's ``link`` field, e.g. ``"/employment-tribunal-decisions/mr-b-king-v-thales-dis-uk-ltd-1403603-slash-2020"`` or ``"/hmrc-internal-manuals/vat-government-and-public-bodies/vatgpb9700"``. A full ``www.gov.uk`` URL is also accepted. Returns: ``GovUkContent`` with ``human_readable_citation``, ``source_url``, ``body_html`` and ``attachments``.
gb_coverage Declare what this connector covers, how it is sourced, and what it does NOT cover. Call this before telling a user that the law "does not contain" something, and whenever a search comes back empty: the absence may be a gap in this connector rather than in the law. Every gap carries a fallback saying where to look instead. Returns: ``Coverage`` with families, an as-of note, and a non-empty list of known gaps.
Permissions 3
network medium filesystem low env_vars low