Skip to main content
Glama

Get Company Profile

company_profile
Read-onlyIdempotent

Retrieve comprehensive Companies House data including status, address, SIC codes, filing compliance, and outstanding charges for a UK company number.

Instructions

Fetch the full Companies House profile for a company number.

Returns status, registered address, SIC codes, filing compliance (overdue accounts and confirmation statement flags), and whether the company has outstanding charges. Use company_search first to find the company number.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
company_numberYesCompanies House company number (8 digits, e.g. '03782379'). Returned by company_search.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
company_numberYesCompanies House company number.
company_nameNoRegistered company name.
company_statusNoCurrent status (active, dissolved, in liquidation, etc.).
company_typeNoCompanies House company type code.
date_of_creationNoIncorporation date (ISO YYYY-MM-DD).
sic_codesNoStandard Industrial Classification codes.
registered_office_addressNoRegistered office address as returned by Companies House.
has_chargesNoTrue if the company has outstanding registered charges (secured debt), derived from the /charges endpoint. A due diligence signal.
accountsNoAccounts filing status and due dates.
confirmation_statementNoConfirmation statement filing status and next due date.

Implementation Reference

  • Tool registration for 'company_profile' — annotated @mcp.tool decorator that defines the tool name, metadata, input parameter schema (company_number), return type (CompanyProfile), and docstring.
    # ------------------------------------------------------------------ #
    # 2. company_profile
    # ------------------------------------------------------------------ #
    @mcp.tool(
        name="company_profile",
        annotations={
            "title": "Get Company Profile",
            "readOnlyHint": True,
            "destructiveHint": False,
            "idempotentHint": True,
            "openWorldHint": True,
        },
    )
    async def company_profile(
        company_number: Annotated[str, Field(description="Companies House company number (8 digits, e.g. '03782379'). Returned by company_search.", min_length=1, max_length=10)],
    ) -> CompanyProfile:
        """Fetch the full Companies House profile for a company number.
    
        Returns status, registered address, SIC codes, filing compliance
        (overdue accounts and confirmation statement flags), and whether
        the company has outstanding charges. Use company_search first to
        find the company number.
        """
        return await _fetch_company_profile(_normalise_company_number(company_number))
  • Handler function for the company_profile tool — normalizes the company number then delegates to _fetch_company_profile.
    async def company_profile(
        company_number: Annotated[str, Field(description="Companies House company number (8 digits, e.g. '03782379'). Returned by company_search.", min_length=1, max_length=10)],
    ) -> CompanyProfile:
        """Fetch the full Companies House profile for a company number.
    
        Returns status, registered address, SIC codes, filing compliance
        (overdue accounts and confirmation statement flags), and whether
        the company has outstanding charges. Use company_search first to
        find the company number.
        """
        return await _fetch_company_profile(_normalise_company_number(company_number))
  • Core fetch logic for company profiles — calls Companies House /company/{number} and /company/{number}/charges endpoints, then constructs and returns a CompanyProfile model.
    async def _fetch_company_profile(company_number: str) -> CompanyProfile:
        async with companies_house_client() as client:
            resp = await _request_with_retry(client, "GET", f"/company/{company_number}")
            data = resp.json()
    
            has_charges = False
            try:
                charges_resp = await _request_with_retry(
                    client, "GET", f"/company/{company_number}/charges",
                    params={"items_per_page": 1},
                )
                charges_data = charges_resp.json()
                charges_items = charges_data.get("items") or []
                has_charges = any(
                    item.get("status") == "outstanding" for item in charges_items
                ) or (
                    charges_data.get("total_count", 0) > 0
                    and not charges_items
                )
            except Exception:
                pass
    
        accs_raw = data.get("accounts") or {}
        conf_raw = data.get("confirmation_statement") or {}
    
        return CompanyProfile(
            company_number=str(data.get("company_number") or company_number),
            company_name=data.get("company_name"),
            company_status=data.get("company_status"),
            company_type=data.get("company_type"),
            date_of_creation=data.get("date_of_creation"),
            sic_codes=list(data.get("sic_codes") or []),
            registered_office_address=data.get("registered_office_address") or {},
            has_charges=has_charges,
            accounts=CompanyAccountsSummary(
                overdue=bool(accs_raw.get("overdue", False)),
                last_accounts_made_up_to=(accs_raw.get("last_accounts") or {}).get("made_up_to"),
                next_due=accs_raw.get("next_due"),
            ),
            confirmation_statement=CompanyConfirmationStatementSummary(
                overdue=bool(conf_raw.get("overdue", False)),
                next_due=conf_raw.get("next_due"),
            ),
        )
  • Pydantic model CompanyProfile — defines the output schema with fields: company_number, company_name, company_status, company_type, date_of_creation, sic_codes, registered_office_address, has_charges, accounts, confirmation_statement.
    class CompanyProfile(BaseModel):
        """Full Companies House profile for a single company number."""
    
        model_config = BASE_CFG
    
        company_number: str = Field(..., description="Companies House company number.")
        company_name: str | None = Field(None, description="Registered company name.")
        company_status: str | None = Field(
            None, description="Current status (active, dissolved, in liquidation, etc.)."
        )
        company_type: str | None = Field(
            None, description="Companies House company type code."
        )
        date_of_creation: str | None = Field(
            None, description="Incorporation date (ISO YYYY-MM-DD)."
        )
        sic_codes: list[str] = Field(
            default_factory=list,
            description="Standard Industrial Classification codes.",
        )
        registered_office_address: dict[str, Any] = Field(
            default_factory=dict,
            description="Registered office address as returned by Companies House.",
        )
        has_charges: bool = Field(
            False,
            description=(
                "True if the company has outstanding registered charges (secured debt), "
                "derived from the /charges endpoint. A due diligence signal."
            ),
        )
        accounts: CompanyAccountsSummary = Field(
            default_factory=CompanyAccountsSummary,
            description="Accounts filing status and due dates.",
        )
        confirmation_statement: CompanyConfirmationStatementSummary = Field(
            default_factory=CompanyConfirmationStatementSummary,
            description="Confirmation statement filing status and next due date.",
        )
  • Helper function _normalise_company_number — pads numeric strings to 8 digits with leading zeros, uppercases alpha strings.
    def _normalise_company_number(v: str) -> str:
        return v.zfill(8) if v.isdigit() else v.upper()
Behavior4/5

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

Annotations already indicate readOnly, idempotent, and nondestructive behavior. The description adds specific return fields (status, address, SIC codes, filing compliance flags, outstanding charges), providing useful context beyond annotations. Could mention data freshness or rate 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?

Two sentences: first states purpose, second lists returned data and prerequisite. Front-loaded, no wasted words.

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?

With an output schema present, the description need not detail return values. It covers purpose, prerequisite, and core data fields. Sufficient for a single-parameter tool with comprehensive annotations.

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 a detailed description of the company_number parameter (format, length, reference to company_search). The description only reiterates that the number is returned by company_search, adding marginal value.

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?

Clearly states 'Fetch the full Companies House profile' for a company number, listing key data fields (status, address, SIC codes, filing compliance, charges). Distinguishes from sibling tools like charity_profile and company_search, which find company numbers.

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?

Explicitly advises 'Use company_search first to find the company number,' providing a clear prerequisite. However, does not mention when to use alternative tools like company_officers or company_psc instead.

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