Skip to main content
Glama

Search UK Due Diligence Registers

search
Read-onlyIdempotent

Search UK due diligence registers in parallel by company, charity, director, or keyword. Returns result IDs to retrieve full 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

  • The 'search' tool handler function. Fans out across Companies House, Charity Commission, disqualified directors, and Gazette insolvency notices in parallel, collects unique prefixed IDs, and returns them.
    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}
  • The register_tools function that registers both 'search' and 'fetch' tools with the FastMCP server. Called from server.py line 164.
    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,
            },
        )
  • Private helper that queries Companies House search API and extracts company prefixed IDs.
    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")]
  • Private helper that queries Charity Commission search API and extracts charity prefixed IDs.
    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
        ]
  • Private helper that queries Companies House disqualified officers search and extracts disqualification prefixed IDs.
    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
Behavior3/5

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

Annotations already provide readOnlyHint, idempotentHint, and openWorldHint. The description adds context about parallel searching and that results are IDs requiring fetch, but doesn't detail rate limits, pagination, or result limits.

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 sentences, each earning its place: first states the action, second lists what is searched, third explains the output and follow-up step. No redundant language.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description explains the return format (list of IDs) and connection to fetch. With an output schema present, this is sufficient. However, it lacks details on pagination or result limits which could affect agent planning.

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?

With 100% schema description coverage, the description adds no additional parameter meaning beyond the schema. The baseline of 3 is appropriate as the schema already explains the query parameter adequately.

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 explicitly states it searches across all UK due diligence registers simultaneously and names specific registers, clearly distinguishing it from sibling tools that target single registers like company_search or 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 tells when to use this tool (broad cross-register search) and what to do next (use fetch to retrieve full records). It implicitly contrasts with sibling tools for specific registers, but could be more explicit about when not to use it.

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