hk-criminal-law
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| HK_LAW_DB | No | Path to the local SQLite corpus database, e.g. "$PWD/data/hk_law.db" or "$PWD/hk_law_public.db". The project-scoped .mcp.json omits it, so the server falls back to its default database path. |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
Hong Kong criminal law and defence research. Case search/read follows the deployment: local-only when HK_LAW_LOCAL_ONLY=1, otherwise live HKLII query-time access with a local fallback; live access remains subject to the source's terms. Agent protocol: call corpus_status or sync_status first; search the DOJ Prosecution Code and prosecution policies with search_doj and read them with get_doj_document; use semantic_search and semantic_neighbors for discovery, then get_section, statute_history, search_cases, and get_case_paragraphs for primary text; run verify_citations (and verify_doj for DOJ policy citations) before relying on anything; label anything unverified [UNVERIFIED]. The semantic atlas is a discovery aid, not authority. This server is a retrieval aid, not a citator of record and not legal advice.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| search_legislationA | Search the locally indexed Hong Kong e-Legislation corpus. Args: query: Words or a phrase, e.g. "bail conditions" or "合理懷疑". cap: Optional Cap number filter, e.g. "221" or "Cap. 221". lang: "en" (default) or "zh-Hant". limit: Maximum results (1-50). include_text: Include the full section text, not just a snippet. |
| get_sectionB | Return a Hong Kong ordinance section or schedule with provenance. Args: cap: Cap number, e.g. "221" or "Cap. 221". section: Section number, e.g. "9J", "s9J", or "sch3". lang: "en" (default) or "zh-Hant". max_chars: Truncate very long sections/schedules to this many characters. |
| get_section_rangeB | Return all sections between two section numbers (inclusive). Example: Cap. 221 sections 9A to 9J. Section ordering handles numeric and letter suffixes. Parts/Orders may restart numbering; read the part context. |
| statute_historyB | Return the provision text in force on a date (YYYY-MM-DD). Uses the official DATA.GOV.HK Past Version archives if ingested. If the
historical corpus is unavailable, returns the current text with
|
| list_section_versionsB | List all historical version dates available for a section. |
| list_ordinancesC | List indexed ordinances/regulations, optionally filtered by title or Cap. |
| search_casesB | Search Hong Kong judgments. The default follows |
| get_caseA | Read a Hong Kong judgment, local by default. Args:
citation: e.g. "[2021] HKCFA 1".
lang: "en" or "zh-Hant".
paragraphs: Optional paragraph numbers/ranges, e.g. ["12", "15-17"].
max_chars: Truncate the returned full text to this many characters.
allow_live: Defaults to |
| get_case_paragraphsC | Return specific paragraphs, local by default.
|
| note_upB | Return note-up data (research aid, not a citator).
|
| verify_citationB | Verify a citation against the corpus.
|
| verify_citationsC | Extract and verify every citation in a passage.
|
| doctrine_researchB | Return legislation hits and ranked case leads for a doctrine or issue.
|
| sentencing_researchB | Return penalty text and sentencing case leads for an offence.
|
| authority_rankingA | Rank case results by court level and note-up data.
|
| case_graphC | Return outgoing cited cases and incoming note-up citations.
|
| corpus_statusA | Report database size, coverage, sync freshness, and local-only mode. |
| sync_statusA | Report local coverage, last sync runs, and permission configuration. |
| search_dojB | Search the DOJ Prosecution Code and prosecution policies. The local DOJ corpus covers the Prosecution Code and the domestic-violence
prosecution policy. |
| get_doj_documentB | Read a DOJ publication by slug, e.g. Args:
slug: e.g. |
| list_doj_documentsC | List indexed DOJ publications and their paragraph counts. |
| verify_dojA | Verify a DOJ policy citation, e.g. This checks the local DOJ corpus only. It is not a citator and does not verify that the paragraph supports a proposition. |
| doj_statusA | Report DOJ corpus coverage, freshness and provenance. |
| sync_dojA | Incrementally update the local DOJ corpus. Fetches the curated Prosecution Code and domestic-violence policy pages
(plus bounded discovery from their index pages), using conditional GETs and
checksums. It is polite and may take 20–60 seconds. The full daily update is
also available as |
| semantic_statusA | Report whether the semantic atlas is available and what it covers. |
| semantic_searchA | Search the semantic atlas's citation/heading index for provisions. This is a metadata/keyword lookup over the generated atlas; use
|
| semantic_locateC | Find a legislation citation's point(s) and cluster in the semantic atlas. |
| semantic_neighborsB | Return provisions nearest to a point or citation in the semantic atlas. Similarity is semantic, not authority or treatment. Verify every result with
|
| semantic_clustersC | List semantic-atlas topics, optionally filtered by label or Cap. title. |
| semantic_clusterC | Show one semantic topic and representative member provisions. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 30 tools
Core families are distinguishable (legislation fetch, case fetch, DOJ, semantic atlas), but several tools sit close together: verify_citation vs verify_citations, get_section vs get_section_range vs statute_history vs list_section_versions, and four separate *_status tools. The five semantic_* tools and the three research pack tools (doctrine_research, sentencing_research, authority_ranking) also overlap in 'find leads' territory, relying on descriptions rather than distinct names to separate them.
The dominant pattern is snake_case verb_noun (search_cases, get_case, verify_citation, sync_doj), which is readable and predictable. However, a sizeable minority are noun phrases with no verb (note_up, statute_history, case_graph, authority_ranking, corpus_status, sync_status, doj_status, semantic_status), and the semantic_* prefix namespace breaks the verb-first convention.
At 30 tools the surface is heavy, and much of the weight is infrastructure/plumbing rather than capability: four *_status tools plus sync_doj/sync_status and five semantic_* tools. A research agent must pick among many near-equivalent entry points, which is more than the domain's core workflows justify.
Coverage is strong for the stated domain: search and retrieval of legislation and judgments, historical versions, range reads, citation extraction/verification, note-up/graph traversal, DOJ policy corpus, and corpus freshness reporting. Gaps are acknowledged rather than hidden (no citator of record, sentence-tariff tables), and agents can work around them by reading full judgments and sections.