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 UK case law judgments using regex or text patterns to find relevant paragraphs for content-based legal research questions.

Instructions

Find paragraphs in a single judgment whose text matches a pattern.

Returns a list of {eId, snippet, match} hits — small per-paragraph snippets centred on the match — so the LLM can decide which full paragraphs to read via judgment://{slug}/para/{eId}.

Use this when answering content-based questions ("what did the judges say about negligence?", "find the test for foreseeability", "did this case cite Donoghue?") rather than navigating by paragraph number (which uses the index resource).

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
paramsYesInput schema for case_law_grep_judgment.

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 openWorldHint=true, covering safety and idempotency. The description adds valuable behavioral context beyond annotations: it explains the return format ('list of {eId, snippet, match} hits — small per-paragraph snippets'), how to use results ('so the LLM can decide which full paragraphs to read via judgment://{slug}/para/{eId}'), and fallback behavior ('if [pattern] doesn't compile, falls back to literal substring search'). It doesn't mention rate limits or auth needs, but with annotations covering core traits, this is strong supplemental context.

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?

The description is efficiently structured: first sentence states purpose, second explains return format and how to use results, third gives usage guidelines with examples, fourth clarifies pattern behavior. Every sentence adds value, with no redundant or vague phrasing. It's front-loaded with core functionality and appropriately sized for the tool's complexity.

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 moderate complexity, rich annotations (readOnly, idempotent, openWorld), 100% schema coverage, and presence of an output schema, the description is complete. It covers purpose, usage context, behavioral details (return format, fallback), and distinguishes from alternatives. The output schema handles return values, so the description appropriately focuses on when and how to use the tool rather than documenting outputs.

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 description coverage is 100%, with all parameters well-documented in the schema. The description adds minimal parameter semantics beyond the schema: it mentions 'pattern is regex' and the fallback behavior, which is already in the schema's pattern description. It doesn't explain slug format or other parameters. With high schema coverage, the baseline is 3, and the description doesn't significantly enhance parameter understanding.

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?

The description clearly states the tool's purpose: 'Find paragraphs in a single judgment whose text matches a pattern.' It specifies the verb ('Find'), resource ('paragraphs in a single judgment'), and scope ('text matches a pattern'), distinguishing it from sibling tools like case_law_search (which likely searches across multiple judgments) and read_resource (which reads a full resource).

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?

The description provides explicit guidance on when to use this tool: 'Use this when answering content-based questions... rather than navigating by paragraph number (which uses the index resource).' It names the alternative ('index resource') and gives concrete examples of appropriate use cases ('what did the judges say about negligence?', 'find the test for foreseeability', 'did this case cite Donoghue?').

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