Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
HK_LAW_DBNoPath 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

CapabilityDetails
tools
{
  "listChanged": false
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}

Tools

Functions exposed to the LLM to take actions

NameDescription
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 historical: false and an explicit warning.

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 HK_LAW_LOCAL_ONLY: local-only when set to 1 (the public launcher default), live HKLII search when set to 0. Live search is for query-time coverage and remains subject to HKLII's terms. court accepts a neutral-citation code such as HKCFA/HKCA/HKCFI/HKDC.

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 HK_LAW_LOCAL_ONLY=0 (live when local-only is off); otherwise a missing case is a coverage gap, not an error to paper over.

get_case_paragraphsC

Return specific paragraphs, local by default.

allow_live follows HK_LAW_LOCAL_ONLY just like :func:get_case.

note_upB

Return note-up data (research aid, not a citator).

allow_live follows HK_LAW_LOCAL_ONLY; the public default uses the cache only.

verify_citationB

Verify a citation against the corpus.

live follows HK_LAW_LOCAL_ONLY; the public default is local. Examples: "Cap. 221 s.9J", "section 9J of Cap. 221", "[2021] HKCFA 1".

verify_citationsC

Extract and verify every citation in a passage.

live follows HK_LAW_LOCAL_ONLY; the public default is local.

doctrine_researchB

Return legislation hits and ranked case leads for a doctrine or issue.

live_cases follows HK_LAW_LOCAL_ONLY; the public release can opt into local-only. This is a discovery pack, not a legal answer. Fetch and read the judgments you intend to cite.

sentencing_researchB

Return penalty text and sentencing case leads for an offence.

live_cases follows HK_LAW_LOCAL_ONLY. Not a sentencing tariff. Extracts penalty language from the provision and searches for sentencing material in the case corpus.

authority_rankingA

Rank case results by court level and note-up data.

live follows HK_LAW_LOCAL_ONLY. Not a citator of record; check later treatment before relying on a case.

case_graphC

Return outgoing cited cases and incoming note-up citations.

live_note_up follows HK_LAW_LOCAL_ONLY; the public default uses the local cache.

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. category is prosecution_code or domestic_violence. This is policy material, not legislation; read the full page before relying on a paragraph.

get_doj_documentB

Read a DOJ publication by slug, e.g. prosecution_ch5.

Args: slug: e.g. prosecution_ch5 or domesticviolence_11. lang: en or zh-Hant. paragraphs: Optional paragraph numbers/ranges, e.g. ["5.9"] or ["14-17"]. max_chars: Truncate the full text to this many characters.

list_doj_documentsC

List indexed DOJ publications and their paragraph counts.

verify_dojA

Verify a DOJ policy citation, e.g. Prosecution Code §5.9.

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 hk-law sync-doj.

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_neighbors for nearest-neighbour discovery. cluster accepts a cluster id or a label fragment; language is en or zh-Hant. Read the provision with get_section and verify it with verify_citation before relying on it.

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 get_section and verify_citation.

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

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

TDQS

C2.9/5.0

Scored across 30 tools

Disambiguation3/5

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.

Naming Consistency3/5

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.

Tool Count2/5

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.

Completeness4/5

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.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues