MCP

Endpoint

Version 1.0.0
https://lexipedia.io/mcp

Available tools

13 tools

search_document

Read only

Search for legal sources

Use this when the user wants to find public Swiss legislation articles, court decisions, publications, preparatory materials, or circulars. Put filters in the Lucene `query` string with canonical snake_case fields. Do not use this for non-Swiss law, private legal records, or general web search.

Parameters

query

Lucene search query. Use this single string for both search terms and filters. - Plain words: national languages - Exact phrases: "good faith" - Mandatory quoting: wrap every multi-word phrase in double quotes. This includes values after a field such as document_title:"code of obligations" and every multi-word alternative in an OR group such as ("plan social" OR "social plan" OR "indemnité de départ"). An unquoted field value ends at the first space; document_title:code of obligations does not search that complete law title. - Boolean operators: contract AND lease, contract OR lease, contract NOT lease - Required/prohibited clauses: +contract -lease - Groups: (contract OR lease) AND nullity - Public snake_case field queries: document_title:constitution, language:en, jurisdiction:ch - Ranges: decision_date:[2020-01-01 TO 2024-12-31] - Trailing wildcards/prefixes: nation*, citation:ATF*, citation:4A* - Fuzzy terms: constitution~1 - Phrase proximity: "good faith"~5 - Boosts: document_title:constitution^2 Public field names: - abbreviation, canton, chamber, citation, citator, clerks, collection, content, council, court, court_name, court_tier, decision_date, document_number, document_title, document_title_short, faction, id, in_force_since, in_force_to, judges, jurisdiction, language, legal_area, number, outcome, parties, party, regest, register, scope, source, status, summary, title, type Where the text is: - Every kind is indexed twice: once whole, once split into the chunks it is made of, and only the chunks carry searchable full text. Each `<kind>_chunk` type holds that text; the whole-document type beside it holds only metadata — number, title, dates, and a decision's regest. - So a query of several content words finds case law as `decision_chunk` results, not as `decision` ones. Each chunk names its document and links to it. Empty `decision` results for a substantive query mean the words are not in the regest; they do not mean the corpus has no such case law. Search `type:decision` for a docket, court, or date, and leave type unset (or use `decision_chunk`) when searching what a court actually said. - Legislation splits the same way: a subject a law is not named after finds nothing at `type:legislation`. Search `type:legislation_chunk` for what provisions say, `type:legislation` for an act you can name. Logical field mappings: - type filters result kinds. Valid values: legislation, legislation_chunk, decision, decision_chunk, publication, publication_chunk, preparatory, preparatory_chunk, circular, circular_chunk, standard, standard_chunk, glossary, person, organization. - id matches canonical refs — the very strings this tool returns as `id`. Hand one straight back: `id:ch:sr-rs-rs:2010-262:fr#art-23` is that one article, and the ref of its parent, `id:ch:sr-rs-rs:2010-262:fr`, is every article of that law. Colons need no quoting; a docket is not a ref, so look one up with citation: or title: instead. - title searches the record's own heading: a chunk's, or a whole document's. - document_title searches the title of the document a chunk belongs to (a document's own). - number is the record's own number: an article number, a chunk number, a docket. - document_title_short and abbreviation search the short name of that document. - document_number addresses the document a chunk belongs to. - court holds canonical colon-form codes (ch:bger, ch-zh:obergericht) — list them with list_values. - court_tier is the court's position in the Swiss judicial hierarchy: 1 supreme, 2 appellate, 3 first instance. Bodies outside the ordinary judiciary (regulators, executives, conciliation) carry none. Field availability is source-aware; fields that do not exist for the selected source simply cannot match. Tips: - Do your queries in french, german, italian, and romansh to not miss any results. - Try at most 3 focused queries. If none match, say that Lexipedia did not find a source; do not assume that no source exists. - Do not report an empty result by itself. Call report_issue only for a reproducible Lexipedia defect and only after the user explicitly asks or confirms. - Write ALL the keywords in lowercase to not interfere with Lucene operators like AND, OR, NOT, etc. This is especially important for the swiss law with the abbreviation "OR" -> "or". Examples: - "right to be heard" AND jurisdiction:vd - type:decision AND decision_date:[2020 TO 2024] - type:preparatory AND "data protection" - document_number:700 AND number:25 - citation:"art. 25 LAT" AND language:fr - court:ch:bge AND decision_date:[2020 TO 2024] - court_tier:1 AND "good faith" - document_title:privacy* AND status:active - type:legislation_chunk AND document_title:"code of obligations" AND ("plan social" OR "social plan" OR "indemnité de départ" OR "indemnites de depart")

string
preferences
object
pagination
object
sort

Optional sort. Examples: { by: 'relevance', order: 'desc' }, { by: 'citation_count', order: 'desc' }, { by: 'date', order: 'desc' }, { by: 'date', order: 'asc' }.

object

get_document

Read only

Get a legal source's details and outline

Use this after search_document returns an `id` to see what a public Swiss legal source is and what it contains: its metadata, how many pages of text it has, and — for a whole law or decision — a `table_of_contents` of its section headers, not its articles. It returns no text. Each outline entry carries the `page` it starts on: pass that to read_document to jump straight there. To read a single article or consideration, call read_document with its id directly; it needs no outline. For a law, `total_versions` says how many consolidated texts it has had over time: call get_document_versions to list them. `total_relations` and `relation_counts` say how many structural links the document has and of which kinds — the acts that amended a law, the decision that reviewed a decision: call get_document_relations to list them. A decision also carries a `citator` standing — `negative` (a later court departed from it, or it was annulled), `caution`, `positive`, `neutral`, or `unanalysed` — with `analysed_citing_decisions` out of `citing_decisions` as the record it rests on. Treat `unanalysed` as no information: it means nobody has examined how later courts treated it, never that it is undisturbed. Use get_document_cited_by with a `treatment` to see the individual verdicts.

Parameters

idRequired

A search_document result id: a canonical reference, e.g. `ch:sr-rs-rs:1999-404:fr#art-8` for one article or consideration, or `ch:sr-rs-rs:1999-404:fr` for a whole law or decision. A reference may carry a past version of a law, as `ch:sr-rs-rs:1999-404@2020-01-01:fr`.

string
preferences
object

get_document_cited_by

Read only

List the documents that cite a legal source

Use this to see which documents cite a public Swiss legal source — the reverse of its own references, the way the website lists citing decisions under an article. Pass a search_document result id: a whole law or decision, or one article (`…#art-8`) to list only the documents citing that article. (A consideration id lists what cites its whole decision — per-consideration filtering does not exist.) Each entry is one distinct citing document, most-cited first, with a snippet of the citing passage (the citation wrapped in <mark>), how many times it cites the target (`occurrence_count`), and an `id` of the citing passage to pass to read_document. `total_documents` counts every citing document and `type_counts` breaks that down by type; `type` filters to one, and `pagination` ({ offset, limit }, as in search_document) pages through the rest. Where a citing decision has been analysed, `treatment` says what it did with the target (followed, distinguished, criticised, declined to follow, changed practice, or merely mentioned) and `treatment_counts` tallies those; `treatment` filters to one of them, or to 'analysed' for every citing document carrying a verdict. A null `treatment` means nobody has analysed that citation — never that the citing court had nothing to say.

Parameters

idRequired

A search_document result id: a canonical reference, e.g. `ch:sr-rs-rs:1999-404:fr#art-8` for one article or consideration, or `ch:sr-rs-rs:1999-404:fr` for a whole law or decision. A reference may carry a past version of a law, as `ch:sr-rs-rs:1999-404@2020-01-01:fr`.

string
type

Only citing documents of this type

decision | law | publication | preparatory | circular
treatment

Only citing documents whose analysed verdict is this one ('analysed' for any)

follows | applies | distinguishes | limits | criticises | declines_to_follow | changes_practice | mentions | other | unknown | analysed
pagination
object
preferences
object

get_document_relations

Read only

List a legal source's structural links

Use this to list the structural links of a public Swiss legal source, when get_document's `total_relations` says it has any. Pass a search_document result id; an article or consideration id lists its document's links. Each entry carries an `id` that is itself a document-tool id. A law names the amendment acts that changed it (`amended_by`, whose `version_dates` are the consolidated versions an act produced) and the act that enacted it (`enacted_by`); an Official Compilation act names what it `amends` or `enacts` and the Federal Gazette item it `follows` (a Gazette item's `resulted_in` is that act); a decision names the challenged decision it reviewed (`reviews`) or the higher decision that reviewed it (`reviewed_by`), whose `effect` — `annulled`, `partially_annulled`, or `annulled_and_remanded` versus `confirmed` or `unreviewed` — says whether the reviewed decision is still good law; an Official Bulletin debate names the parliamentary business it deliberates (`debates`), and a Curia Vista business names its floor debates (`debated_in`); a published leading case (BGE/ATF/DTF) names the full judgment it excerpts (`publishes`), and the judgment names its published form (`published_as`); a consultation names the law its draft is foreseen to impact (`concerns`), and the law names the consultations held over it (`consulted_in`); an act names the works it completely repealed (`repeals`), and a repealed law names the act that ended it (`repealed_by`); a Federal Gazette item names the Curia Vista business it documents (`documents`), and the business names its Gazette paper trail (`documented_in`). `relation_counts` always tallies every kind the document has, so a page dominated by one kind never hides another; `relation` filters to one kind and `pagination` ({ offset, limit }) pages through it. `total_relations` counts the filtered set. For which documents cite a source, use get_document_cited_by instead — these are the editorial links, not citations.

Parameters

idRequired

A search_document result id: a canonical reference, e.g. `ch:sr-rs-rs:1999-404:fr#art-8` for one article or consideration, or `ch:sr-rs-rs:1999-404:fr` for a whole law or decision. A reference may carry a past version of a law, as `ch:sr-rs-rs:1999-404@2020-01-01:fr`.

string
relation

Only links of this kind

amends | amended_by | enacts | enacted_by | follows | resulted_in | reviews | reviewed_by | debates | debated_in | publishes | published_as | concerns | consulted_in | repeals | repealed_by | documents | documented_in
pagination
object
preferences
object

get_document_versions

Read only

List the consolidated versions a law has had

Use this to list the consolidated texts a law has had over time, when get_document's `total_versions` says it has more than one. Pass a search_document result id; an article id lists the versions of the law it belongs to. Entries come newest first, each with the `version` key to pass to read_document to read the law — or one article of it — as it stood then, its in-force window, and the languages it was published in. `pagination` ({ offset, limit }) pages into older history. Only legislation is consolidated: a decision, publication or circular is published once and never restated, so it answers with an empty list.

Parameters

idRequired

A search_document result id: a canonical reference, e.g. `ch:sr-rs-rs:1999-404:fr#art-8` for one article or consideration, or `ch:sr-rs-rs:1999-404:fr` for a whole law or decision. A reference may carry a past version of a law, as `ch:sr-rs-rs:1999-404@2020-01-01:fr`.

string
pagination
object
preferences
object

get_schema

Read only

Get the corpus schema

Use this before run_query to inspect the PostgreSQL tables, columns, relationships, and query guidance available for the public Swiss legal corpus.

Parameters

No parameters

list_pages

Read only

List the website's main pages

Use this to discover the main pages of the Lexipedia website — what exists and what each page is for — before reading one with read_page. Also lists the patterned page families (source collections, document pages) and how to reach an instance of each. Every path accepts a locale prefix (en, de, fr, it, rm), e.g. `/de/documents`.

Parameters

No parameters

list_people

Read only

List Swiss lawyers and parliamentarians

Use this when the user wants to find a person the Swiss public registers list — a lawyer, a member of the Federal Assembly, or both, since one human is one row. It covers every lawyer entered in a cantonal bar register (with firm, town and how many published decisions name them as counsel) and everyone in the Parliament register — National Councillors, Councillors of States, federal councillors and chancellors — with party, parliamentary group and how many recorded debates they spoke in. Filter by name or firm (`query`), `role`, `canton`, `city`, `firm_uid`, `council` (NR/SR/BR), `party` (register number from a previous result), `active`, `active_in` (a year: who held a seat then, described as they were then) or first `letter`; results are alphabetical by family name, or ranked with `sort: cases` / `sort: speeches`, and paginated with `pagination`. Every filter is optional and they compound, so pass only the ones you hold a real value for: a filter invented to fill the field empties the answer. Do not use this for judges, notaries or people outside Switzerland; an absent lawyer is not one who does not exist (Bern and Ticino publish no machine-readable register), and the speech record starts with the Winter session of 1999.

Parameters

query

A name fragment, or a firm name. Matches the family name, the given name and the current firm.

string
role

Narrow to one register: `lawyer` for the cantonal bar registers, `parliamentarian` for the Federal Assembly. One human is one row, so a lawyer who sits in parliament appears under both and carries both facets either way. Leave it empty to search everyone.

lawyer | parliamentarian
canton

Two-letter canton code: the bar register the lawyer is entered in, or the canton that elected the member — either match counts.

AG | AI | AR | BE | BL | BS | FR | GE | GL | GR | JU | LU | NE | NW | OW | SG | SH | SO | SZ | TG | TI | UR | VD | VS | ZG | ZH
city

The town of a lawyer’s business address: "Lausanne", "Zürich", "Küsnacht ZH". Case and accents are folded, so "zurich" finds Zürich. Parliamentarians carry no town.

string
firm_uid

The commercial-register identifier (UID) of a law firm, exactly as a previous result gave it in `firm_uid`, e.g. CHE-123.456.789. Never write one from memory and leave it empty when you hold none: to find a firm by its name, pass the name as `query` instead.

string
council

NR for the National Council, SR for the Council of States, BR for a Federal Council mandate; the member’s latest seat.

NR | SR | BR
party

The party’s register number, exactly as a previous result gave it in `party_id`. Never write one from memory.

string
active

True lists only members holding a council seat today.

boolean
active_in

A year: only members who held a council seat during it — and each row’s council, canton, party and faction then describe that period, not today. The Federal State exists since 1848.

integer
letter

First letter of the family name, accents folded (Ö files under O). Leave it empty to list every letter.

string
sort

`name` (the default) lists alphabetically by family name; `cases` puts the lawyers with the most published decisions naming them as counsel first; `speeches` puts the members with the most recorded debate contributions first. Both counts measure the published record, never the whole practice or career.

string
pagination
object
preferences
object

list_values

Read only

List available search values

Use this when the user needs valid filter values for a Lexipedia search field, such as courts, sources, languages, or jurisdictions. Results are paginated in pages of 50. Do not use this to search legal documents or to infer that a value is legally authoritative.

Parameters

fieldRequired

Listable Lucene field. Available fields: canton, chamber, citator, collection, council, court, court_tier, faction, jurisdiction, language, legal_area, outcome, party, register, scope, source, status

canton | chamber | citator | collection | council | court | court_tier | faction | jurisdiction | language | legal_area | outcome | party | register | scope | source | status
page

1-based page number. Each page returns up to 50 values.

integer
preferences
object

read_document

Read only

Read a legal source's text

Use this to read the text of a public Swiss legal source: an article or consideration in full, or a page range of a whole law or decision. Call get_document first for a long source — its table of contents gives the page each section starts on, so you can read that page instead of paging from the beginning. A single article or consideration needs no outline: read it directly by its id. Without a `version` it serves the text in force today; pass one from get_document's `versions` to read the law as it stood then. The response reports the range it actually served, which is clamped to the document.

Parameters

idRequired

A search_document result id: a canonical reference, e.g. `ch:sr-rs-rs:1999-404:fr#art-8` for one article or consideration, or `ch:sr-rs-rs:1999-404:fr` for a whole law or decision. A reference may carry a past version of a law, as `ch:sr-rs-rs:1999-404@2020-01-01:fr`.

string
from

First page to read, about 10000 characters per page. Use the page a table_of_contents entry gives to start at that section.

integer
to

Last page to read. Defaults to `from`; at most 3 pages are served per call, and the response says which range it returned.

integer
version

Read a past consolidated version of a law instead of the text in force today: a `version` from get_document's `versions`. Only legislation has versions, and only the current text is searchable, so an id always comes from a search of today's law. A table_of_contents page number describes the current text, so in an older version a section may sit a page or so away.

string
preferences
object

read_page

Read only

Read a page of the website

Use this to read any public page of the Lexipedia website itself — /terms, /privacy, /coverage, a /browse listing, or any path a result URL points at — converted to markdown. Pages are served in the same page ranges as read_document, so a long page is read a few pages at a time. Paths may carry a locale prefix (/de/terms) to read that language. For the text of a law or decision prefer read_document, which reads the stored source directly.

Parameters

pathRequired

Site path of the page to read, e.g. `/terms` or `/de/browse`. A full URL on the site's own domain is also accepted.

string
from

First page to read, about 10000 characters per page.

integer
to

Last page to read. Defaults to `from`; at most 3 pages are served per call, and the response says which range it returned.

integer

report_issue

Writes data

Report an issue

Use this only after the user explicitly asks or confirms that Lexipedia should create an internal issue about incorrect, incomplete, stale, or broken search_document or retrieval results. This writes a private issue record; do not include personal data, secrets, or private legal material. Do not use it merely because search_document returned no matches.

Parameters

issueRequired

Clear description of the issue the agent discovered.

string
categoryRequired

Triage category for the issue.

content | metadata | search | retrieval | mcp_tool | performance | other
severityRequired

Expected impact of the issue.

info | warning | error
contextRequired

Only non-sensitive context needed to reproduce the issue. Never include personal data, credentials, tokens, or private legal records.

object

run_query

Read only

Query the corpus with SQL

Use this when a question about the Swiss legal corpus needs counts, aggregation, joins, date ranges, or citation-graph structure that search_document cannot answer. Call get_schema first, and prefer search_document and get_document for finding legal texts. Runs one read-only SQL statement against the public corpus. Rows are capped and long cells truncated; queries time out after a few seconds, so filter and aggregate instead of scanning whole tables.

Parameters

queryRequired

Single read-only SQL statement (PostgreSQL 18). Call get_schema first for readable tables, columns, relationships, and query guidance.

string
limit

Maximum rows to return (hard cap 200).

integer