Skip to main content
Glama

Search Disqualified Directors

disqualified_search
Read-onlyIdempotent

Check if a named person is disqualified from acting as a UK company director, retrieving disqualification details and officer IDs.

Instructions

Check whether a named individual is banned from acting as a UK company director.

Use this tool when asked to check disqualified, banned, or barred directors. Query must be an individual's name (e.g. "Richard Howson") — NOT a company name, which always returns zero results.

Returns names, dates of birth, disqualification period snippets, and officer IDs that can be used with disqualified_profile for full details.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesName of the person to search for
items_per_pageNoResults per page (max 100). Default 20.
start_indexNoPagination offset (0-based). Default 0.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query applied.
total_resultsYesTotal matching records upstream at Companies House.
start_indexYesPagination offset for this page.
items_per_pageYesPage size requested.
returnedYesItems actually returned on this page.
has_moreYesTrue if more items may exist beyond this page. Re-call with start_index=start_index+items_per_page to continue.
itemsNoMatching disqualified officer records.

Implementation Reference

  • disqualified.py:36-108 (registration)
    The `register_tools` function registers the `disqualified_search` tool on the FastMCP server via the `@mcp.tool` decorator at line 45-54. The tool is named 'disqualified_search' and is exposed as an MCP tool.
    # ---------------------------------------------------------------------------
    # Tool registration
    # ---------------------------------------------------------------------------
    
    def register_tools(mcp: FastMCP) -> None:
    
        # ------------------------------------------------------------------ #
        # 1. disqualified_search
        # ------------------------------------------------------------------ #
        @mcp.tool(
            name="disqualified_search",
            annotations={
                "title": "Search Disqualified Directors",
                "readOnlyHint": True,
                "destructiveHint": False,
                "idempotentHint": True,
                "openWorldHint": True,
            },
        )
        async def disqualified_search(
            query: Annotated[str, Field(description="Name of the person to search for", min_length=2, max_length=200)],
            items_per_page: Annotated[int, Field(description="Results per page (max 100). Default 20.", ge=1, le=100)] = 20,
            start_index: Annotated[int, Field(description="Pagination offset (0-based). Default 0.", ge=0, le=10000)] = 0,
        ) -> DisqualifiedSearchResult:
            """Check whether a named individual is banned from acting as a UK company director.
    
            Use this tool when asked to check disqualified, banned, or barred directors.
            Query must be an individual's name (e.g. "Richard Howson") — NOT a company
            name, which always returns zero results.
    
            Returns names, dates of birth, disqualification period snippets, and
            officer IDs that can be used with disqualified_profile for full details.
            """
            try:
                async with companies_house_client() as client:
                    resp = await _request_with_retry(
                        client, "GET", "/search/disqualified-officers",
                        params={
                            "q": query.strip(),
                            "items_per_page": items_per_page,
                            "start_index": start_index,
                        },
                    )
                    data = resp.json()
            except Exception:
                data = {}
    
            raw_items = data.get("items", []) or []
            total_results = int(data.get("total_results", 0) or 0)
    
            items = [
                DisqualifiedSearchItem(
                    officer_id=_extract_officer_id(raw.get("links") or {}),
                    title=raw.get("title"),
                    date_of_birth=raw.get("date_of_birth"),
                    snippet=raw.get("snippet"),
                    address=raw.get("address") or {},
                    links=raw.get("links") or {},
                )
                for raw in raw_items
            ]
    
            has_more = (start_index + len(items)) < total_results
    
            return DisqualifiedSearchResult(
                query=query,
                total_results=total_results,
                start_index=start_index,
                items_per_page=items_per_page,
                returned=len(items),
                has_more=has_more,
                items=items,
            )
  • The `disqualified_search` async function is the core handler that executes the tool logic. It takes a person's name (query), items_per_page, and start_index, then calls the Companies House API endpoint `/search/disqualified-officers` with retry logic, parses results into `DisqualifiedSearchItem` objects, and returns a `DisqualifiedSearchResult`.
    async def disqualified_search(
        query: Annotated[str, Field(description="Name of the person to search for", min_length=2, max_length=200)],
        items_per_page: Annotated[int, Field(description="Results per page (max 100). Default 20.", ge=1, le=100)] = 20,
        start_index: Annotated[int, Field(description="Pagination offset (0-based). Default 0.", ge=0, le=10000)] = 0,
    ) -> DisqualifiedSearchResult:
        """Check whether a named individual is banned from acting as a UK company director.
    
        Use this tool when asked to check disqualified, banned, or barred directors.
        Query must be an individual's name (e.g. "Richard Howson") — NOT a company
        name, which always returns zero results.
    
        Returns names, dates of birth, disqualification period snippets, and
        officer IDs that can be used with disqualified_profile for full details.
        """
        try:
            async with companies_house_client() as client:
                resp = await _request_with_retry(
                    client, "GET", "/search/disqualified-officers",
                    params={
                        "q": query.strip(),
                        "items_per_page": items_per_page,
                        "start_index": start_index,
                    },
                )
                data = resp.json()
        except Exception:
            data = {}
    
        raw_items = data.get("items", []) or []
        total_results = int(data.get("total_results", 0) or 0)
    
        items = [
            DisqualifiedSearchItem(
                officer_id=_extract_officer_id(raw.get("links") or {}),
                title=raw.get("title"),
                date_of_birth=raw.get("date_of_birth"),
                snippet=raw.get("snippet"),
                address=raw.get("address") or {},
                links=raw.get("links") or {},
            )
            for raw in raw_items
        ]
    
        has_more = (start_index + len(items)) < total_results
    
        return DisqualifiedSearchResult(
            query=query,
            total_results=total_results,
            start_index=start_index,
            items_per_page=items_per_page,
            returned=len(items),
            has_more=has_more,
            items=items,
        )
  • `DisqualifiedSearchItem` (lines 323-351) and `DisqualifiedSearchResult` (lines 354-376) are Pydantic models defining the output schema for the disqualified_search tool. They include fields like officer_id, title, date_of_birth, address, pagination fields (total_results, start_index, has_more), and the list of items.
    class DisqualifiedSearchItem(BaseModel):
        """A single hit in a disqualified officers search."""
    
        model_config = BASE_CFG
    
        officer_id: str | None = Field(
            None,
            description=(
                "Companies House officer ID extracted from the self link. Pass to "
                "disqualified_profile for the full disqualification record."
            ),
        )
        title: str | None = Field(
            None, description="Display title (typically the officer's name)."
        )
        date_of_birth: str | None = Field(
            None, description="Date of birth as returned by the search API."
        )
        snippet: str | None = Field(
            None, description="Upstream match snippet highlighting query terms."
        )
        address: dict[str, Any] = Field(
            default_factory=dict,
            description="Last known address of the disqualified officer.",
        )
        links: dict[str, Any] = Field(
            default_factory=dict,
            description="Upstream relational links (self, etc.).",
        )
    
    
    class DisqualifiedSearchResult(BaseModel):
        """Paginated disqualified officers search result."""
    
        model_config = BASE_CFG
    
        query: str = Field(..., description="Search query applied.")
        total_results: int = Field(
            ..., description="Total matching records upstream at Companies House."
        )
        start_index: int = Field(..., description="Pagination offset for this page.")
        items_per_page: int = Field(..., description="Page size requested.")
        returned: int = Field(..., description="Items actually returned on this page.")
        has_more: bool = Field(
            ...,
            description=(
                "True if more items may exist beyond this page. Re-call with "
                "start_index=start_index+items_per_page to continue."
            ),
        )
        items: list[DisqualifiedSearchItem] = Field(
            default_factory=list,
            description="Matching disqualified officer records.",
        )
  • server.py:158-164 (registration)
    The top-level server registration at line 160 calls `disqualified.register_tools(mcp)`, which triggers the registration of the `disqualified_search` tool from the disqualified module.
    companies_house.register_tools(mcp)
    charity.register_tools(mcp)
    disqualified.register_tools(mcp)
    land_registry.register_tools(mcp)
    gazette.register_tools(mcp)
    hmrc_vat.register_tools(mcp)
    search_fetch.register_tools(mcp)
  • The `_extract_officer_id` helper function extracts the officer ID from the 'self' link in the API response, used to populate the `officer_id` field in `DisqualifiedSearchItem`.
    def _extract_officer_id(links: dict[str, Any]) -> str | None:
        self_link = (links or {}).get("self", "") if isinstance(links, dict) else ""
        if not self_link:
            return None
        tail = self_link.rstrip("/").rsplit("/", 1)[-1]
        return tail or None
Behavior4/5

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

Annotations declare readOnlyHint=true and destructiveHint=false, so description builds on this by noting that querying a company name yields zero results, and lists return fields. This adds useful behavioral context beyond annotations, though pagination limits are only implied by schema.

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?

The description is four well-structured sentences, starting with the core purpose, then usage notes, then return data. Every sentence adds value without redundancy.

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 that an output schema exists, the description does not need to elaborate on return structure, but it still mentions key fields (names, DOB, disqualification snippets, officer IDs) and links to disqualified_profile. The tool's pagination parameters are adequately covered by the schema.

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%, with clear descriptions for all three parameters. The description reinforces the query parameter's constraint to individual names, but adds no new meaning for items_per_page or start_index. Baseline 3 is appropriate.

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 'Check whether a named individual is banned from acting as a UK company director,' using a specific verb and resource, and distinguishes from sibling tools like company_search or charity_search by specifying the domain of disqualified directors.

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?

The description explicitly says 'Use this tool when asked to check disqualified, banned, or barred directors,' and warns against using company names, which would return zero results. It also references disqualified_profile for further details, providing clear guidance.

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