Skip to main content
Glama
paulieb89

UK Business Tools - Ledgerhall

by paulieb89

Search within a UK Court Judgment

law_case_law_grep_judgment
Read-onlyIdempotent

Find matching paragraphs in a UK judgment using regex or plain text. Get snippets and eIds, then read full paragraphs via judgment_get_paragraph or judgment:// resource.

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.
max_hitsNoCap on number of hits returned.
case_insensitiveNoDefault true. Set false for case-sensitive matching.

Output Schema

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

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.1

TDQS

A4.7/5.0
Behavior5/5

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

Adds value beyond the annotations (readOnlyHint, idempotentHint) by disclosing the exact return shape ({eId, snippet, match}), the 'small per-paragraph snippets' behavior, and the regex fallback to literal substring matching. No contradiction with annotations.

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?

Well-structured and front-loaded with the trigger condition. Every sentence adds value: return format, use case, alternatives, and regex behavior. No fluff or repetition.

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?

For a search tool with an existing output schema, the description covers the key usage scenario, distinguishes from related tools, explains the regex behavior, and points to the next step for reading full paragraphs. This is complete and self-sufficient.

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 each parameter is already described. The description reinforces that 'pattern' is regex with fallback, but does not add new parameter-specific syntax or constraints beyond the schema. Baseline 3 is appropriate when schema carries the param load.

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 opens with a specific verb+resource combo: 'find paragraphs whose text matches a pattern' within a UK Court Judgment. It clearly distinguishes from sibling tools like judgment_get_index and judgment_get_paragraph, and from broader search tools.

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?

Explicit when-to-use statement ('USE THIS TOOL WHEN you have a judgment slug...'), a concrete use case, and direct alternatives: 'For paragraph-number navigation by eId, call judgment_get_index instead.' Also explains the follow-up step to read full paragraphs.

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

Deploy Server

Other Tools