Les outilsThe tools
Le patron d'usage est en deux temps : s'orienter, puis extraire. Les premiers outils servent à trouver où regarder ; les suivants rendent le texte officiel. Tous sont en lecture seule — aucun n'écrit quoi que ce soit.
The usage pattern has two beats: orient yourself, then extract. The first tools find where to look; the rest return the official text. All are read-only — none writes anything.
S'orienterOrient
legislation_find_relevant
Repérage de sources — heuristiqueSource discovery — heuristic
Le point d'entrée quand on part d'un problème plutôt que d'une loi. On décrit la situation en langage libre — « vice caché maison », « congédiement sans préavis », « bail commercial » — et l'outil rend une liste de lois et de chapitres candidats, chacun accompagné du motif de son rapprochement.
Le classement est entièrement déterministe : aucun modèle de langue n'intervient. Quatre signaux se cumulent — la matière de la taxonomie, l'intitulé des divisions, le nom des lois, et le voisinage dans le graphe des textes. Chaque candidat expose ses preuves, de sorte que le rapprochement est vérifiable plutôt que devinable.
C'est une aide au repérage, pas une réponse juridique : elle ne détermine pas le droit applicable. Le résultat sert à choisir où lire, puis on extrait le texte avec les outils de structure et d'article.
The entry point when you start from a problem rather than from a statute. You describe the situation in free language — “latent defect house”, “dismissal without notice”, “commercial lease” — and the tool returns candidate statutes and chapters, each with the reason it was matched.
Ranking is entirely deterministic: no language model is involved. Four signals accumulate — the taxonomy subject, division headings, statute names, and adjacency in the graph of related texts. Every candidate exposes its evidence, so a match can be checked rather than guessed.
This is a retrieval aid, not a legal answer: it does not determine the applicable law. Its output tells you where to read; you then extract the text with the structure and article tools.
legislation_list_laws
Carte du corpusCorpus map
La carte complète du corpus : chaque loi avec son identifiant, ses titres français et anglais, sa citation RLRQ, les langues disponibles, sa date de consolidation et son nombre d'articles.
S'y ajoutent les attributs de découverte : la fonction du texte (loi, règlement, règles de procédure, tarif), le forum devant lequel il s'applique, les matières auxquelles il est rattaché, et la loi habilitante lorsqu'il s'agit d'un règlement. Pour les deux grands codes, le plan des Livres et de leurs Titres est inclus.
Trois filtres permettent de restreindre la carte : par fonction, par forum, ou par matière. C'est le point de départ pour explorer le corpus lorsqu'on sait ce qu'on cherche ; pour partir d'un problème concret, l'outil de repérage est plus direct.
The full map of the corpus: each statute with its identifier, French and English titles, RLRQ citation, available languages, consolidation date and article count.
Discovery attributes come with it: the text's function (statute, regulation, rules of procedure, tariff), the forum it governs, the subjects it belongs to, and the enabling statute where the text is a regulation. For the two major codes, the outline of Books and their Titles is included.
Three filters narrow the map: by function, by forum, or by subject. This is where to start when exploring a known corpus; to start from a concrete problem, the discovery tool is more direct.
legislation_list_subjects
Matières de la taxonomieTaxonomy subjects
La taxonomie qui organise le corpus, en deux familles : les matières du droit privé, calquées sur les Livres du Code civil du Québec, et les matières spécialisées, qui regroupent les lois sectorielles et leurs règlements.
Chaque matière porte un libellé et une description bilingues, ainsi que le nombre de lois et de divisions qui lui sont rattachées. Elle sert à choisir un domaine, puis à filtrer la carte du corpus.
La description d'une matière n'est pas de la prose d'agrément : c'est la surface sur laquelle s'apparient les termes d'une requête. Le vocabulaire qu'elle contient est celui que l'on veut voir reconnu — ce qui en fait le principal levier de calibrage éditorial du repérage.
The taxonomy that organizes the corpus, in two families: private-law subjects, mapped onto the Books of the Civil Code of Québec, and specialized subjects, which group sectoral statutes with their regulations.
Each subject carries a bilingual label and description, along with the number of statutes and divisions attached to it. It is used to pick a domain, then to filter the corpus map.
A subject's description is not decorative prose: it is the surface against which query terms are matched. The vocabulary it contains is the vocabulary meant to be recognized — which makes it the main editorial lever for tuning discovery.
legislation_related_laws
Lois reliéesRelated statutes
Le graphe d'interconnexion d'une loi : les règlements pris sous son autorité, la loi qui l'habilite, les renvois qu'elle fait vers d'autres textes, et les relations curées à la main lorsqu'un lien juridique mérite d'être qualifié — met en œuvre, applique, complète, encadré par, connexe.
Les arêtes peuvent être suivies dans les deux sens, filtrées par type, et limitées en nombre. Chaque relation indique si elle a été dérivée automatiquement ou curée, et les relations curées portent une note expliquant le lien.
L'outil signale explicitement les cibles qui ne sont pas au corpus : un renvoi vers une loi non chargée est affiché comme tel plutôt que passé sous silence. Ces cibles absentes sont autant de candidats d'acquisition.
Les noms de lois suivent la langue demandée. Les notes des relations curées, elles, n'existent qu'en français : sous une demande anglaise elles sont rendues MARQUÉES [fr] plutôt que maquillées en traduction, et l'étiquette voyage aussi dans les données structurées.
A statute's interconnection graph: regulations made under its authority, the statute that enables it, cross-references it makes to other texts, and hand-curated relations where a legal link deserves to be characterized — implements, applies, supplements, governed by, related.
Edges can be followed in either direction, filtered by type, and capped in number. Each relation states whether it was derived automatically or curated, and curated relations carry a note explaining the link.
The tool explicitly flags targets that are not in the corpus: a reference to a statute that has not been loaded is shown as such rather than silently dropped. Those absent targets are acquisition candidates.
Statute names follow the requested language. The notes attached to curated relations, however, exist only in French: under an English request they are returned MARKED [fr] rather than passed off as a translation, and the label travels in the structured payload as well.
ExtraireExtract
legislation_get_article
Texte officiel d'un articleOfficial text of an article
Le texte officiel d'un article, restitué verbatim, avec sa citation, sa position dans la hiérarchie du texte, sa date de consolidation et sa ligne d'historique législatif. Les articles abrogés sont rendus et signalés comme tels.
Les numéros décimaux du Code civil et des lois modernes sont pris en charge, de même que les dispositions qui n'ont pas de numéro — la disposition préliminaire et les dispositions finales se demandent par leur nom.
Si le numéro demandé n'existe pas, l'outil ne devine pas : il propose les articles voisins. Un article manquant est signalé, jamais remplacé par son plus proche parent.
The official text of an article, returned verbatim, with its citation, its position in the text's hierarchy, its consolidation date and its legislative history line. Repealed articles are returned and flagged as such.
Decimal numbering used by the Civil Code and modern statutes is supported, as are provisions without a number — the preliminary provision and the final provisions are requested by name.
If the requested number does not exist, the tool does not guess: it offers the neighbouring articles. A missing article is reported, never substituted with its nearest sibling.
legislation_get_articles
Textes officiels en lotOfficial texts in bulk
Plusieurs articles en une seule demande, soit par plage continue, soit par liste explicite de numéros. La réponse est paginée, ce qui permet de parcourir un chapitre entier sans saturer le contexte.
Le mode plage respecte l'ordre réel des articles du texte, y compris les numéros décimaux insérés entre deux articles entiers — les bornes sont lues en base plutôt que recalculées, ce qui rend la plage insensible aux particularités de numérotation d'un texte donné.
Several articles in a single request, either as a continuous range or as an explicit list of numbers. The response is paginated, which makes it possible to walk through an entire chapter without flooding the context.
Range mode follows the text's real article order, including decimal numbers inserted between two whole ones — the bounds are read from the database rather than recomputed, which makes ranges immune to a given text's numbering quirks.
legislation_get_structure
Structure d'une loi (sans texte)Structure of a statute (no text)
L'arbre hiérarchique d'une loi — Livre, Titre, Chapitre, Section, Sous-section — sans le texte des articles. C'est l'outil qui permet de comprendre l'économie d'un texte avant d'en extraire quoi que ce soit.
Chaque nœud donne son type, son numéro, son intitulé et son chemin. Le chemin est la clé qui sert ensuite à demander une division précise. La profondeur d'affichage se règle, et l'on peut se restreindre à un sous-arbre.
Les chemins sont propres à chaque langue, puisqu'ils dérivent du balisage officiel. Un chemin obtenu en français reste néanmoins utilisable en anglais : il est traduit automatiquement par le pont des numéros d'articles.
The hierarchical tree of a statute — Book, Title, Chapter, Division, Subsection — without article text. This is the tool for understanding how a text is organized before extracting anything from it.
Each node gives its kind, number, heading and path. The path is the key used afterwards to request a specific division. Display depth is adjustable, and you can restrict the view to a subtree.
Paths are language-specific, since they derive from the official markup. A path obtained in French nonetheless remains usable in English: it is translated automatically through the article-number bridge.
legislation_get_division
Texte officiel d'une divisionOfficial text of a division
Une division entière — un Livre, un Titre, un Chapitre, une Section — avec son intitulé, ses sous-divisions immédiates et les articles qu'elle contient, tout son sous-arbre compris. La réponse est paginée.
On peut ne demander que les numéros d'articles, sans leur texte, pour arpenter un gros chapitre à faible coût avant de cibler.
Lorsqu'un intitulé n'existe que dans une langue, celui de l'autre langue est rendu et marqué comme tel, plutôt que d'afficher un vide silencieux.
A whole division — a Book, Title, Chapter or Division — with its heading, its immediate subdivisions and the articles it contains, across its entire subtree. The response is paginated.
You can request article numbers only, without their text, to survey a large chapter cheaply before narrowing down.
Where a heading exists in only one language, the other language's heading is returned and marked as such, rather than displaying a silent blank.
legislation_search_text
Recherche plein texte — replis étiquetésFull-text search — labelled fallbacks
La recherche dans le texte même des articles, insensible aux accents, combinant un moteur lexical et un moteur sémantique. Chaque résultat arrive avec son fil d'Ariane complet et un extrait surligné, de sorte qu'on sait d'où il vient sans avoir à le demander.
Le trait déterminant de cet outil est qu'il dit toujours comment il a obtenu ses résultats. Si la correspondance exacte échoue, il élargit, relâche ou bascule au sémantique — mais il annonce lequel de ces chemins a produit la réponse, en prose comme dans les données structurées. Un résultat approché n'est jamais présenté comme une correspondance exacte.
Une recherche restreinte à une loi qui ne donne rien est automatiquement étendue au corpus ; une recherche restreinte qui donne des résultats signale tout de même ce qui existe ailleurs. Les résultats à l'échelle du corpus sont regroupés par loi, avec un plafond par loi, pour qu'un texte volumineux ne monopolise pas le classement.
Search within the article text itself, accent-insensitive, combining a lexical engine and a semantic one. Each result arrives with its full breadcrumb and a highlighted excerpt, so you know where it comes from without having to ask.
The defining trait of this tool is that it always states how it obtained its results. When exact matching fails, it widens, relaxes, or falls back to semantic retrieval — but it announces which of those paths produced the answer, in prose and in the structured payload alike. An approximate result is never presented as an exact match.
A search restricted to one statute that returns nothing is automatically widened to the corpus; a restricted search that does return results still reports what exists elsewhere. Corpus-wide results are grouped by statute, with a per-statute cap, so that a voluminous text cannot monopolize the ranking.
legislation_resolve_reference
Résolution d'une citationCitation resolution
D'une citation écrite en langage libre vers l'article officiel qu'elle désigne. L'outil reconnaît le chapitre RLRQ de n'importe quelle loi du corpus, ainsi que les abréviations usuelles des deux grands codes.
Il indique par quelle voie la citation a été reconnue, ce qui permet de vérifier la résolution plutôt que de la prendre pour acquise.
Un chapitre RLRQ absent du corpus n'est jamais rabattu sur un chapitre voisin : l'outil refuse explicitement de résoudre plutôt que de rendre l'article d'une autre loi. Dans un outil juridique, un résultat faux rendu en silence est le pire défaut possible.
From a citation written in free form to the official article it designates. The tool recognizes the RLRQ chapter of any statute in the corpus, as well as the usual abbreviations of the two major codes.
It reports how the citation was recognized, which lets you verify the resolution rather than take it on trust.
An RLRQ chapter absent from the corpus is never rounded to a neighbouring chapter: the tool explicitly declines to resolve rather than return an article from a different statute. In a legal tool, a wrong result delivered silently is the worst possible defect.
Les aides au repérageRetrieval aids
Le repérage ne devine pas. Il combine un classement déterministe, une recherche lexicale et une recherche sémantique — et chacun de ces chemins est annoncé dans la réponse. On peut donc toujours savoir pourquoi un texte a été proposé, et à quel titre.
Discovery does not guess. It combines deterministic ranking, lexical search and semantic search — and every one of those paths is announced in the response. You can always tell why a text was proposed, and on what basis.
Les quatre signaux du classementThe four ranking signals
Le classement des candidats est une somme de signaux, sans aucun appel de modèle de langue. Le même texte, interrogé deux fois par les mêmes termes, rend le même classement.
La matière pèse le plus lourd : lorsqu'un terme de la requête se retrouve dans le libellé ou la description d'une matière de la taxonomie, toutes les lois rattachées à cette matière deviennent candidates. Viennent ensuite l'intitulé des divisions et le nom des lois, à poids égal. Enfin, un saut dans le graphe des relations ajoute un appoint : une loi voisine d'un bon candidat gagne un point, une seule fois, et seulement par une relation curée ou par un lien de règlement à loi habilitante.
Trois correctifs empêchent ce cumul de dériver. Un terme qui ne touche que quelques textes pèse davantage qu'un terme générique — dans un corpus entièrement juridique, « procédure » ou « contrat » n'apprennent presque rien, tandis que « courtage » ou « expropriation » désignent. Et une même matière ne peut fournir qu'un nombre borné de candidats, faute de quoi une matière riche en textes remplirait à elle seule la liste et en évincerait le code applicable.
Le troisième correctif pèse la part de la question que le candidat explique réellement. Sans lui, un texte rapproché par un seul mot sur six marquait autant que s'il avait été rapproché par un mot sur deux : le score ne dépendait pas de la question posée, et une loi hors sujet qui partageait un mot avec le libellé d'une matière pouvait devancer le code applicable. Comme la pondération par spécificité, ce correctif est continu et non par seuil — précisément pour que le classement ne bascule pas le jour où une loi de plus est ajoutée au corpus.
Candidate ranking is a sum of signals, with no language-model call anywhere. The same query, run twice with the same terms, yields the same ranking.
Subject matter carries the most weight: when a query term appears in the label or description of a taxonomy subject, every statute attached to that subject becomes a candidate. Division headings and statute names follow, at equal weight. Finally, one hop through the relations graph adds a small bonus: a statute adjacent to a strong candidate gains a point, once only, and only through a curated relation or a regulation-to-enabling-statute link.
Three corrections keep that accumulation from drifting. A term that touches only a few texts weighs more than a generic one — in a corpus that is entirely legal, “procedure” or “contract” teach almost nothing, whereas “brokerage” or “expropriation” designate. And a single subject may contribute only a bounded number of candidates, failing which a text-rich subject would fill the list on its own and crowd out the governing code.
The third correction weighs how much of the question a candidate actually accounts for. Without it, a text matched on one word out of six scored exactly as much as if it had been matched on one word out of two: the score did not depend on the question asked, and an off-topic statute sharing a single word with a subject label could outrank the governing code. Like the specificity weighting, this correction is continuous rather than threshold-based — precisely so the ranking does not tip the day one more statute is added to the corpus.
- matièresubject +3
- intitulé de divisiondivision heading +2
- nom de loistatute name +2
- voisin de graphegraph neighbour +1
- candidats max par matièremax candidates per subject 3
- suffixe max appariémax matched suffix 4
- facteur de spécificitéspecificity factor ×2 jusqu'à 4 textesup to 4 texts
- plancher sémantiquesemantic floor 0.4
- fusion RRFRRF fusion k = 60, profondeur 20depth 20
L'échelle de recherche, et ses étiquettesThe search ladder, and its labels
La recherche plein texte descend une échelle, du plus exact au plus approximatif. Un barreau n'arrête la descente que s'il rend assez de résultats : une liste d'un seul article la laisse continuer, parce qu'un barreau plus permissif trouve souvent la bonne réponse là où le précédent n'avait accroché qu'un texte marginal.
Elle tente d'abord la correspondance exacte dans la portée demandée. Si une recherche restreinte à une loi ne donne rien, elle est élargie au corpus. Si l'exact échoue partout, elle réessaie en retirant un terme à la fois, puis en acceptant qu'un seul des termes suffise. En dernier recours seulement, elle propose des articles trouvés par proximité de sens. Ce relâchement n'est pas un luxe : le moteur lexical ne connaît aucune famille de mots en français, si bien qu'une question posée avec « garantie » n'atteint pas d'elle-même un texte qui dit « garantir ».
Chaque barreau pose une étiquette qui voyage avec la réponse — dans le texte rendu et dans les données structurées. On sait donc toujours si l'on regarde une correspondance exacte, un résultat obtenu en ignorant un terme, ou un rapprochement purement sémantique. Le repli est permis ; le repli silencieux ne l'est pas.
Full-text search walks down a ladder, from most exact to most approximate. A rung only halts the descent if it yields enough results: a list holding a single article lets the ladder carry on, because a more permissive rung often finds the right answer where the previous one had caught only a marginal text.
It first attempts an exact match within the requested scope. If a search restricted to one statute returns nothing, it is widened to the corpus. If exact matching fails everywhere, it retries by dropping one term at a time, then by accepting that a single term suffices. Only as a last resort does it offer articles found by closeness of meaning. That relaxation is no luxury: the lexical engine knows no French word families, so a question phrased with “garantie” does not by itself reach a text that says “garantir”.
Every rung sets a label that travels with the response — in the rendered text and in the structured payload alike. You can therefore always tell whether you are looking at an exact match, a result obtained by ignoring a term, or a purely semantic association. Falling back is permitted; falling back silently is not.
Lexical et sémantique, fusionnésLexical and semantic, fused
Les deux moteurs ne se remplacent pas : ils se fusionnent. La liste lexicale et la liste sémantique sont combinées par un rang réciproque, ce qui évite d'avoir à comparer des échelles de score incommensurables. Un article trouvé par les deux voies remonte naturellement.
Le moteur sémantique repose sur des plongements multilingues, ce qui lui donne deux usages précis : franchir l'écart de vocabulaire — une recherche sur « congédiement » atteint « délai de congé » — et franchir la barrière de langue, une requête en anglais atteignant le texte français.
Un plancher de similarité est appliqué, et il est calibré par mesure et non au jugé. Sans lui, une requête en charabia recevrait quand même ses plus proches voisins, présentés comme des résultats. Sous ce plancher, l'outil préfère ne rien rendre.
The two engines do not replace one another: they are fused. The lexical list and the semantic list are combined by reciprocal rank, which avoids having to compare incommensurable score scales. An article found by both routes naturally rises.
The semantic engine rests on multilingual embeddings, which gives it two precise uses: bridging the vocabulary gap — a search for “dismissal” reaches “notice of termination” — and bridging the language barrier, an English query reaching the French text.
A similarity floor is applied, and it is calibrated by measurement rather than by judgement. Without it, a gibberish query would still receive its nearest neighbours, presented as results. Below that floor, the tool prefers to return nothing.
LimitesLimits
L'aide au repérage est heuristique. Elle propose où lire ; elle ne détermine pas le droit applicable.
Le texte des articles est restitué verbatim, sans altération : depuis les EPUB officiels de LégisQuébec pour les textes du Québec, et depuis les XML du ministère de la Justice du Canada pour les textes fédéraux. La version officielle est celle publiée par l'Éditeur officiel du Québec, et pour le fédéral celle publiée par le ministre (art. 31 de la Loi sur la révision et la codification des textes législatifs) : c'est elle qui fait foi. Ce service n'est pas une version officielle. Il contient de l'information publiée sous la Licence du gouvernement ouvert – Canada.
Ce service ne fournit aucun conseil juridique. Les dates de consolidation affichées indiquent l'état du corpus chargé ici, qui peut accuser un retard sur la publication officielle.
The retrieval aid is heuristic. It suggests where to read; it does not determine the applicable law.
Article text is returned verbatim, unaltered: from the official LégisQuébec EPUBs for Québec texts, and from Department of Justice Canada XML for federal texts. The official version is the one published by the Québec Official Publisher, and for federal texts the one published by the Minister (s. 31, Legislation Revision and Consolidation Act): that version is the authoritative one. This service is not an official version. It contains information licensed under the Open Government Licence – Canada.
This service provides no legal advice. The consolidation dates shown reflect the state of the corpus loaded here, which may lag the official publication.
AccèsAccess
Ce serveur est une instance privée. L'endpoint MCP n'est ouvert qu'aux clients autorisés (par paramètre d'authentification ou en-tête d'autorisation) : chacun reçoit son propre jeton, révocable séparément, et une requête qui n'en porte pas de valide n'obtient rien — pas même la confirmation que l'endpoint existe. Pour en demander l'accès, écrire à jason@poirierlavoie.ca.
Une fiche publique de découverte MCP (SEP-2127) sans secret est exposée sur https://legislation.poirierlavoie.ca/mcp/server-card ; le dépôt inclut les manifestes pour Google Antigravity (plugin.json, mcp_config.json) et Gemini CLI (gemini-extension.json).
Le code source est public et le corpus est reproductible : le pipeline d'ingestion, la taxonomie et les données de configuration sont tous versionnés.
This server is a private instance. The MCP endpoint is open to authorized clients only (by authentication parameter or authorization header): each one gets its own token, revocable on its own, and a request that does not carry a valid one gets nothing — not even confirmation that the endpoint exists. To request access, write to jason@poirierlavoie.ca.
A public MCP Server Card (SEP-2127) without secrets is published at https://legislation.poirierlavoie.ca/mcp/server-card; the repository ships manifests for Google Antigravity (plugin.json, mcp_config.json) and Gemini CLI (gemini-extension.json).
The source code is public and the corpus is reproducible: the ingestion pipeline, the taxonomy and the configuration data are all version-controlled.
github.com/jpoirierlavoie/MCP-Legislation