Get Gazette Notice Full Text
gazette_noticeFetch complete legal wording and linked data for a Gazette notice by its numeric ID. Ideal for due diligence after finding notice IDs via gazette_insolvency.
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:162-174 (handler)The main tool handler for gazette_notice. Takes a numeric notice_id and returns the full JSON-LD linked-data record from The Gazette API.
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:138-143 (helper)Shared HTTP helper that fetches the Gazette notice data from the live API endpoint.
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:152-161 (registration)Tool registration decorator binding the gazette_notice tool to the FastMCP server. Registered via gazette.register_tools(mcp) in server.py:162.
@mcp.tool( name="gazette_notice", annotations={ "title": "Get Gazette Notice Full Text", "readOnlyHint": True, "destructiveHint": False, "idempotentHint": True, "openWorldHint": True, }, ) - gazette.py:271-284 (helper)Resource registration using the same _fetch_gazette_notice helper, exposed as a notice://{notice_id} resource.
@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)Pydantic model defining the schema for a GazetteNotice, returned as part of GazetteInsolvencyResult.
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}." ), )