Skip to main content
Glama

search_legislation

Read-onlyIdempotent

Search indexed Hong Kong e-Legislation by keyword or phrase, filter by Cap number and language, and return snippets or full section text for legal research.

Instructions

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.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "query": "<query>"
    },
    "name": "search_legislation"
  }
}

Input Schema

NameRequiredDescriptionDefault
capNo
langNoen
limitNo
queryYes
max_charsNo
include_textNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A3.6/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint, idempotentHint, destructiveHint=false and openWorldHint=false, so the safety profile is covered. The description adds the behavioral fact that results come from a locally indexed corpus, but does not elaborate on index staleness, ranking, or whether results are snippets or sections.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

One sentence of purpose followed by a compact Args list; every line carries information and the resource scope is front-loaded. Nothing is padded or redundant.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a six-parameter tool with no output schema, the description covers most parameters but omits max_chars and never describes the shape of a result beyond the include_text hint. It is adequate to get a call right, but an agent cannot anticipate result structure or truncation behavior.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description carries the burden, and it documents five of six parameters with useful examples: bilingual query examples, cap formats like '221' or 'Cap. 221', the lang value set, and a 1-50 range for limit. Only max_chars is left undocumented.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource: search of the locally indexed Hong Kong e-Legislation corpus. The corpus qualifier distinguishes it implicitly from search_cases and search_doj. It stops short of explicitly naming a sibling it is not, so it is clear but not fully differentiated.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No when-to-use or when-not-to-use guidance is given, and no alternative such as semantic_search or get_section is mentioned. Usage is only implied by the fact that the target corpus is legislation, which an agent must infer.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.