Skip to main content
Glama

Search UK Due Diligence Registers

search
Read-onlyIdempotent

Search UK Companies House, Charity Commission, disqualified directors, and Gazette insolvency registers simultaneously, returning result IDs for detailed records.

Instructions

Search across all UK due diligence registers simultaneously.

Searches Companies House, Charity Commission, disqualified directors, and Gazette insolvency notices in parallel. Returns a list of result IDs — use fetch with each ID to retrieve the full record.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesCompany name, charity name, director name, or keyword to search for across all UK due diligence registers

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • server.py:164-164 (registration)
    Registration of the search tool: calls search_fetch.register_tools(mcp) which registers both 'search' and 'fetch' tools on the MCP server.
    search_fetch.register_tools(mcp)
  • Tool registration decorator defining the 'search' tool with metadata annotations.
    def register_tools(mcp: FastMCP) -> None:
    
        @mcp.tool(
            name="search",
            annotations={
                "title": "Search UK Due Diligence Registers",
                "readOnlyHint": True,
                "destructiveHint": False,
                "idempotentHint": True,
                "openWorldHint": True,
            },
        )
  • Handler function that fans out the query across Companies House, Charity Commission, disqualified directors, and Gazette insolvency notices in parallel, deduplicates results, and returns a list of IDs.
    async def search(
        query: Annotated[str, Field(description="Company name, charity name, director name, or keyword to search for across all UK due diligence registers", min_length=2, max_length=200)],
    ) -> dict:
        """Search across all UK due diligence registers simultaneously.
    
        Searches Companies House, Charity Commission, disqualified directors,
        and Gazette insolvency notices in parallel. Returns a list of result
        IDs — use fetch with each ID to retrieve the full record.
        """
        tasks = [
            _company_ids(query),
            _charity_ids(query),
            _disqualified_ids(query),
            _gazette_ids(query),
        ]
        results = await asyncio.gather(*tasks, return_exceptions=True)
    
        ids: list[str] = []
        seen: set[str] = set()
        for result in results:
            if isinstance(result, Exception):
                continue
            for id_ in result:
                if id_ not in seen:
                    seen.add(id_)
                    ids.append(id_)
    
        return {"ids": ids}
  • Input schema: a single 'query' string parameter with length constraints and a description.
    async def search(
        query: Annotated[str, Field(description="Company name, charity name, director name, or keyword to search for across all UK due diligence registers", min_length=2, max_length=200)],
    ) -> dict:
  • Helper that searches Companies House and returns prefixed IDs (company:{number}).
    async def _company_ids(query: str) -> list[str]:
        async with companies_house_client() as client:
            resp = await _request_with_retry(
                client, "GET", "/search/companies",
                params={"q": query, "items_per_page": 10},
            )
        items = resp.json().get("items") or []
        return [f"company:{item['company_number']}" for item in items if item.get("company_number")]
  • Helper that searches Charity Commission and returns prefixed IDs (charity:{number}).
    async def _charity_ids(query: str) -> list[str]:
        async with charity_client() as client:
            resp = await _request_with_retry(
                client, "GET", f"/searchCharityName/{query}",
            )
        data = resp.json()
        all_items = data if isinstance(data, list) else []
        return [
            f"charity:{item['reg_charity_number']}"
            for item in all_items[:5]
            if item.get("reg_charity_number") is not None
        ]
  • Helper that searches disqualified officers and returns prefixed IDs (disqualification:{officer_id}).
    async def _disqualified_ids(query: str) -> list[str]:
        async with companies_house_client() as client:
            resp = await _request_with_retry(
                client, "GET", "/search/disqualified-officers",
                params={"q": query, "items_per_page": 5},
            )
        items = resp.json().get("items") or []
        ids = []
        for item in items:
            links = item.get("links") or {}
            self_link = links.get("self", "") if isinstance(links, dict) else ""
            if self_link:
                officer_id = self_link.rstrip("/").rsplit("/", 1)[-1]
                if officer_id:
                    ids.append(f"disqualification:{officer_id}")
        return ids
  • Helper that searches Gazette insolvency notices and returns prefixed IDs (notice:{notice_id}).
    async def _gazette_ids(query: str) -> list[str]:
        async with gazette_client() as client:
            resp = await _request_with_retry(
                client, "GET", "/insolvency/notice/data.json",
                params={"text": query, "results-page-size": 5},
            )
        raw = resp.json()
        entries = raw.get("entry", []) if isinstance(raw, dict) else []
        if isinstance(entries, dict):
            entries = [entries]
        ids = []
        for entry in entries:
            notice_uri = entry.get("id", "")
            if notice_uri:
                numeric_id = notice_uri.rstrip("/").split("/")[-1]
                if numeric_id:
                    ids.append(f"notice:{numeric_id}")
        return ids
Behavior4/5

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

Annotations already declare readOnlyHint, destructiveHint, idempotentHint. The description adds behavioral details: parallel search across registers and the ID-based retrieval pattern, without contradicting 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?

Three concise sentences: purpose, details, result workflow. Front-loaded and no extraneous information.

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 simple schema, existence of output schema, and annotations, the description covers all essential aspects: what it searches, how it returns results, and the follow-up action (fetch).

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?

The single parameter 'query' has a detailed schema description (100% coverage). The tool description reiterates types of queries but does not add new semantic information beyond the 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?

The description clearly states the tool searches across all UK due diligence registers simultaneously, listing specific registers (Companies House, Charity Commission, etc.). This distinguishes it from individual register search siblings like company_search and charity_search.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies when to use (broad cross-register search) and the workflow (returns IDs to fetch later). It does not explicitly state alternatives or when not to use, but the context of sibling tools makes it clear.

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-due-diligence-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server