Get Gazette Notice Full Text
gazette_noticeRetrieve the full legal wording and JSON-LD linked data of a UK Gazette notice by numeric notice ID. Use with gazette_insolvency for compliance and due diligence.
Instructions
Fetch the full legal wording of a Gazette notice by numeric notice ID.
Returns the complete JSON-LD linked-data record for the notice: parties, legal basis, court, and full text. Use gazette_insolvency first to find notice_numeric_id values.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| notice_id | Yes | Numeric Gazette notice ID. Returned as notice_numeric_id by gazette_insolvency. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- gazette.py:138-143 (helper)Shared fetch helper that calls the Gazette API to retrieve a full notice by numeric ID. Used by both the tool and the resource handlers.
async def _fetch_gazette_notice(notice_id: str) -> dict: url = f"https://www.thegazette.co.uk/notice/{notice_id.strip()}/data.json?view=linked-data" async with httpx.AsyncClient(timeout=15.0) as client: resp = await client.get(url, headers={"Accept": "application/json"}) resp.raise_for_status() return resp.json() - gazette.py:150-174 (handler)Tool handler and registration: defines the 'gazette_notice' tool via @mcp.tool decorator, taking a notice_id string and returning the full JSON-LD data from _fetch_gazette_notice.
def register_tools(mcp: FastMCP) -> None: @mcp.tool( name="gazette_notice", annotations={ "title": "Get Gazette Notice Full Text", "readOnlyHint": True, "destructiveHint": False, "idempotentHint": True, "openWorldHint": True, }, ) async def gazette_notice( notice_id: Annotated[str, Field( description="Numeric Gazette notice ID. Returned as notice_numeric_id by gazette_insolvency.", min_length=1, max_length=20, )], ) -> dict: """Fetch the full legal wording of a Gazette notice by numeric notice ID. Returns the complete JSON-LD linked-data record for the notice: parties, legal basis, court, and full text. Use gazette_insolvency first to find notice_numeric_id values. """ return await _fetch_gazette_notice(notice_id) - gazette.py:269-284 (registration)Resource registration: also named 'gazette_notice', registered as a resource at notice://{notice_id}, returns JSON dump of the fetched notice data.
def register_resources(mcp: FastMCP) -> None: @mcp.resource( "notice://{notice_id}", name="gazette_notice", description=( "Full content of a Gazette notice by numeric notice ID. " "Use the notice_numeric_id returned by gazette_insolvency. " "Returns JSON-LD linked-data view of the notice." ), mime_type="application/json", ) async def gazette_notice_resource(notice_id: str) -> str: import json data = await _fetch_gazette_notice(notice_id) return json.dumps(data) - models.py:683-728 (schema)GazetteNotice Pydantic model used for individual notice entries in the gazette_insolvency result (not directly the gazette_notice tool, but related schema).
class GazetteNotice(BaseModel): """A single corporate insolvency notice from The Gazette.""" model_config = BASE_CFG notice_id: str | None = Field( None, description="Gazette notice URI (e.g. 'https://www.thegazette.co.uk/id/notice/5122793')." ) notice_numeric_id: str | None = Field( None, description=( "Numeric notice ID. Read full notice content via the " "notice://{notice_numeric_id} resource." ), ) notice_code: str | None = Field( None, description=( "Gazette notice code (e.g. '2443' winding-up order, '2448' " "administration order)." ), ) notice_type: str | None = Field( None, description="Human-readable notice type label (e.g. 'Winding-Up Order').", ) severity: int = Field( 0, description=( "Internal severity score 0-10. Higher = more serious (10 = " "Winding-Up Order, 9 = Administration Order / Receiver, 0 = " "unclassified)." ), ) date: str | None = Field( None, description="Publication date (ISO YYYY-MM-DD).", ) title: str | None = Field(None, description="Notice title.") content: str | None = Field( None, description=( "Brief notice excerpt from the search feed (HTML stripped). " "For full legal wording read notice://{notice_numeric_id}." ), ) - server.py:160-162 (registration)Top-level server registration: gazette.register_tools(mcp) is called to register all Gazette tools including gazette_notice.
disqualified.register_tools(mcp) land_registry.register_tools(mcp) gazette.register_tools(mcp)