Skip to main content
Glama
paulieb89

UK Legal Research MCP Server

Search within a UK Court Judgment

case_law_grep_judgment
Read-onlyIdempotent

Search within a specific UK judgment using a regex pattern to find matching paragraphs with context snippets. Useful for locating terms like 'negligence' or 'foreseeability'.

Instructions

USE THIS TOOL WHEN you have a judgment slug and want to find paragraphs whose text matches a pattern.

Returns a list of {eId, snippet, match} hits — small per-paragraph snippets centred on the match. AFTER calling, read full paragraphs via judgment_get_paragraph(slug, eId) or the judgment://{slug}/para/{eId} resource.

Use case: content search within one judgment (e.g. "negligence", "test for foreseeability", "Donoghue"). For paragraph-number navigation by eId, call judgment_get_index instead.

Pattern is regex; if it doesn't compile, falls back to literal substring search.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
paramsYesCaseLawGrepInput.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
slugYesThe judgment slug that was searched
patternYesThe pattern that was searched for
hitsYesMatching paragraphs in document order
truncatedYesTrue if hit count reached max_hits and more matches may exist
Behavior4/5

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

Annotations already provide readOnlyHint, destructiveHint, idempotentHint, openWorldHint. Description adds details: regex pattern fallback to literal substring, output structure (list of hits), and suggests next steps for reading full paragraphs. No contradictions.

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?

Description is concise and well-structured: first sentence states purpose, second explains output, third gives follow-up, fourth covers use case and alternative, fifth adds technical detail. No fluff.

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

Completeness5/5

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

Given the tool's functionality (search within a single judgment), annotations (safe, idempotent), and presence of output schema, the description covers all necessary aspects: when to use, what it returns, how to proceed, and alternatives.

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

Parameters3/5

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

Input schema has 100% description coverage, so parameters are well-documented in schema. Description doesn't add much beyond that for parameters. The regex fallback behavior is mentioned but is already in schema description.

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

Purpose5/5

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

Description clearly states the tool searches within a specific UK Court Judgment for paragraphs matching a pattern. It specifies the input (judgment slug) and output (list of hits with eId, snippet, match). Distinguishes from sibling tools like judgment_get_index and judgment_get_paragraph.

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

Usage Guidelines5/5

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

Explicitly starts with 'USE THIS TOOL WHEN' and provides concrete use cases (searching for terms like 'negligence'). Clearly states when to use an alternative (paragraph-number navigation) and names the alternative tool (judgment_get_index).

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/paulieb89/uk-legal-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server