--- name: lovdata-mcp description: Use when researching Norwegian laws, regulations, or legal provisions via the lovdata-mcp MCP server. Covers tool usage, search strategy, citation format, and data quality caveats. Triggered by questions about Norwegian legislation, legal references, or when the lovdata-mcp server is connected. --- # Lovdata MCP — Companion Skill You have the `lovdata-mcp` MCP server connected. It provides access to 4500+ Norwegian laws and regulations with 136 000+ individual provisions. Full-text search (Norwegian tsvector) and semantic search (vector embeddings) are available. **This skill covers search strategy, citation, and data quality awareness.** ## Available MCP tools | Tool | Purpose | |---|---| | `get_law` | Get a single law/regulation by doc_id | | `list_laws` | List laws with optional type filter (`lov`/`forskrift`) | | `search_laws_fulltext` | Norwegian full-text search across law titles and metadata | | `search_laws_semantic` | Semantic (meaning-based) search across laws | | `get_law_content` | Get full HTML content of a law | | `get_law_text` | Get plain text content of a law | | `get_provision` | Get a single provision by ID | | `get_provisions_batch` | Get multiple provisions by ID | | `list_provisions` | List provisions for a given law | | `search_provisions_fulltext` | Norwegian full-text search across provisions | | `search_provisions_semantic` | Semantic search across provisions | | `get_cross_references` | Get cross-references from a specific provision | | `get_cross_references_by_law` | Get all cross-references for a law | | `resolve_reference` | Resolve a legal reference string to a database record | | `health_check` | Server and database status | | `license_info` | NLOD 2.0 attribution | ## Workflow 1. **Find the law** — `search_laws_fulltext("helsepersonell")` or `list_laws(law_type="lov")` 2. **Get its provisions** — `list_provisions(lov_id=)` to see all sections 3. **Search within provisions** — `search_provisions_fulltext` for exact terms, `search_provisions_semantic` for concepts 4. **Follow references** — `get_cross_references(provision_id)` to find related provisions 5. **Get full text** — `get_law_text(doc_id)` if you need the complete document ## CRITICAL: Fulltext vs semantic search — use the right one | Use case | Tool | Why | |---|---|---| | Known § or exact legal term | `search_provisions_fulltext` | Exact Norwegian stemming, reliable | | Conceptual question ("hva sier loven om...") | `search_provisions_semantic` | Finds meaning, not just words | | Known law name or short title | `search_laws_fulltext` | Matches title, short title, department | **Semantic search uses a similarity threshold of 0.7.** Below that, results are returned with `below_threshold: true` and a suggestion to rephrase. This is expected for vague queries — don't treat low-similarity results as authoritative matches. **Fulltext search uses Norwegian stemming.** Queries like "personopplysning" will match "personopplysninger", "personopplysningsloven", etc. ## Citation format Use standard Norwegian legal citation with Lovdata doc_id: ``` Helsepersonelloven (lov 1999-07-02-64) § 8 doc_id: NL/lov/1999-07-02-64 ``` ``` Forskrift om tilskudd til lokale lyd- og bildemedier (forskrift 2016-02-19-166) § 3 doc_id: SF/forskrift/2016-02-19-166 ``` The `doc_id` field uniquely identifies each law. It follows the pattern: - Laws: `NL/lov/YYYY-MM-DD-NR` - Regulations: `SF/forskrift/YYYY-MM-DD-NR` ## Data model **Three levels:** - `lover` (laws) — the document: title, type, department, legal area, dates - `bestemmelser` (provisions) — individual sections within a law: §, ledd, punkt - `kryssreferanser` (cross-references) — links between provisions **Hierarchy fields on provisions:** - `artikkel` — section number (e.g. "8", "2-1", "8a") - `ledd` — paragraph within section - `punkt` — point within paragraph - `kapittel` — chapter - `henvisning` — reference string (e.g. "§8") ## Data quality — MUST READ ### Not all provisions have § numbers About 31% of provisions lack `artikkel` and `henvisning`. These are: - **Preambles** — introductory text before § 1 - **Ikrafttredelsesbestemmelser** — entry-into-force clauses after the last § - **Unnumbered content** — older laws and simple regulations without § structure - **List items** — enumerated points extracted from bullet lists These provisions are searchable and have full text — they just can't be cited by §. ### Repealed provisions are filtered Provisions containing only "– – –" (Lovdata's convention for repealed/deleted sections) are excluded from the database. If a § reference returns no result, the provision may have been repealed. ### Laws vs regulations | Type | Count | Description | |---|---|---| | `lov` | ~780 | Acts passed by Stortinget | | `forskrift` | ~3700 | Regulations issued by ministries/agencies | Use `list_laws(law_type="lov")` or `list_laws(law_type="forskrift")` to filter. ### Cross-references resolve to law level only `get_cross_references` returns `til_lov_id` (target law) but NOT `til_bestemmelse_id` (target provision). To find the specific target provision, use the `henvisningstekst` field and search within the target law. ### Nynorsk and bokmal Some laws are written in nynorsk. The database contains one version per law — bokmal where both versions exist (Grunnloven). The `html lang` attribute indicates the language. ### Very large laws Some regulations (kosmetikkforskriften, Ukraina-sanksjoner) have 100 000+ characters. Law-level semantic search is based on the first ~8000 characters only. For large documents, **search at provision level** for meaningful semantic results. ### Semantic search similarity Results below the 0.7 threshold are still returned (the single closest match) with metadata explaining the situation. Do not present below-threshold results as confident matches — tell the user the query didn't find a strong match and suggest alternatives. ## Attribution Data is published under NLOD 2.0 by [Lovdata](https://lovdata.no/). Always include attribution when presenting results to users. The `license_info` tool returns the full license text.