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 UK judgment for paragraphs matching a regex or substring pattern, returning snippets and eIDs for further reading.

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
slugYesTNA judgment slug, e.g. 'uksc/2024/12' or 'ewca/civ/2023/450'.
patternYesRegex pattern (or plain substring) to search within paragraph text. If the pattern doesn't compile as regex, falls back to literal substring match.
case_insensitiveNoDefault true. Set false for case-sensitive matching.
max_hitsNoCap on number of hits returned.

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 declare readOnlyHint=true, destructiveHint=false, idempotentHint=true, and description adds return format (list of {eId, snippet, match}), regex fallback to literal substring, and cap on max_hits.

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 front-loaded with 'USE THIS TOOL WHEN', followed by concise bullets. Every sentence adds value without redundancy.

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 complexity (search within judgment with regex), the description covers input, output, and post-call procedure. Output schema exists, and description explains return value structure.

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?

Schema coverage is 100%, so baseline 3. Description repeats fallback behavior for pattern and default for case_insensitive, but does not add significant new meaning beyond schema.

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?

Title and description clearly state 'Search within a UK Court Judgment' with specific verb and resource. Distinguishes from sibling judgment_get_index which is for paragraph-number navigation.

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 says 'USE THIS TOOL WHEN you have a judgment slug and want to find paragraphs whose text matches a pattern.' Also provides when-not-to-use alternatives like judgment_get_index for paragraph navigation.

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