Skip to main content
Glama

Search Charity Commission Register

charity_search
Read-onlyIdempotent

Search the Charity Commission register of England and Wales by name or keyword. Find matching charities with registration details and status.

Instructions

Search the Charity Commission register of England and Wales by name or keyword.

Returns matching charities with registration number, status, and registration date. Use charity_profile for full details once you have the charity number. The upstream searchCharityName endpoint returns the full list in one shot — pagination is applied client-side via offset/limit.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesCharity name or keyword to search for
offsetNoNumber of items to skip before this page. Default 0.
limitNoMax items to return in this page. Default 20; raise to 100 for bulk views.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch term applied.
totalYesTotal matches returned by upstream.
offsetYesNumber of items skipped before this page (client-side).
limitYesMax items requested for this page.
returnedYesItems actually returned on this page.
has_moreYesTrue if more items may exist beyond this page. Re-call with offset=offset+returned to continue.
charitiesNoMatching charity records.

Implementation Reference

  • The async function that executes the charity_search tool logic. It calls the Charity Commission API at /searchCharityName/{query}, applies client-side pagination (offset/limit), maps the response into CharitySearchItem objects, and returns a CharitySearchResult.
    async def charity_search(
        query: Annotated[str, Field(description="Charity name or keyword to search for", min_length=2, max_length=200)],
        offset: Annotated[int, Field(description="Number of items to skip before this page. Default 0.", ge=0, le=10000)] = 0,
        limit: Annotated[int, Field(description="Max items to return in this page. Default 20; raise to 100 for bulk views.", ge=1, le=100)] = 20,
    ) -> CharitySearchResult:
        """Search the Charity Commission register of England and Wales by name or keyword.
    
        Returns matching charities with registration number, status, and
        registration date. Use charity_profile for full details once you
        have the charity number. The upstream `searchCharityName` endpoint
        returns the full list in one shot — pagination is applied
        client-side via offset/limit.
        """
        async with charity_client() as client:
            resp = await _request_with_retry(
                client, "GET",
                f"/searchCharityName/{query}",
            )
            data = resp.json()
    
        # API returns a list of charity objects directly
        all_charities = data if isinstance(data, list) else []
        total = len(all_charities)
    
        page_slice = all_charities[offset : offset + limit]
    
        items: list[CharitySearchItem] = []
        for raw in page_slice:
            raw_status = raw.get("reg_status")
            items.append(
                CharitySearchItem(
                    charity_number=str(raw.get("reg_charity_number")) if raw.get("reg_charity_number") is not None else None,
                    charity_name=raw.get("charity_name"),
                    reg_status=raw_status,
                    reg_status_label=_STATUS_LABELS.get(raw_status or "", raw_status),
                    date_of_registration=(raw.get("date_of_registration") or "")[:10] or None,
                )
            )
    
        has_more = (offset + len(items)) < total
    
        return CharitySearchResult(
            query=query,
            total=total,
            offset=offset,
            limit=limit,
            returned=len(items),
            has_more=has_more,
            charities=items,
        )
  • charity.py:56-65 (registration)
    The @mcp.tool decorator that registers 'charity_search' with FastMCP, including annotations for title, readOnlyHint, destructiveHint, idempotentHint, and openWorldHint.
    @mcp.tool(
        name="charity_search",
        annotations={
            "title": "Search Charity Commission Register",
            "readOnlyHint": True,
            "destructiveHint": False,
            "idempotentHint": True,
            "openWorldHint": True,
        },
    )
  • Pydantic models CharitySearchItem and CharitySearchResult defining the input/output schema for the charity_search tool.
    class CharitySearchItem(BaseModel):
        """A single hit in a Charity Commission name search."""
    
        model_config = BASE_CFG
    
        charity_number: str | None = Field(
            None,
            description=(
                "Charity Commission registration number. Pass to charity_profile "
                "for the full record."
            ),
        )
        charity_name: str | None = Field(None, description="Registered charity name.")
        reg_status: str | None = Field(
            None,
            description=(
                "Registration status code as returned upstream: 'R' registered, "
                "'RM' removed."
            ),
        )
        reg_status_label: str | None = Field(
            None,
            description="Human-readable registration status ('Registered', 'Removed').",
        )
        date_of_registration: str | None = Field(
            None, description="Date of first registration (ISO YYYY-MM-DD)."
        )
    
    
    class CharitySearchResult(BaseModel):
        """Paginated result of a Charity Commission name search."""
    
        model_config = BASE_CFG
    
        query: str = Field(..., description="Search term applied.")
        total: int = Field(..., description="Total matches returned by upstream.")
        offset: int = Field(
            ..., description="Number of items skipped before this page (client-side)."
        )
        limit: int = Field(..., description="Max items requested for this page.")
        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 "
                "offset=offset+returned to continue."
            ),
        )
        charities: list[CharitySearchItem] = Field(
            default_factory=list,
            description="Matching charity records.",
        )
  • server.py:154-159 (registration)
    Top-level server registration: imports the charity module and calls charity.register_tools(mcp), which triggers the @mcp.tool decorator for charity_search.
    import companies_house, charity, disqualified, land_registry, gazette, hmrc_vat, search_fetch
    import prompts as prompts_module
    from fastmcp.server.transforms import PromptsAsTools
    
    companies_house.register_tools(mcp)
    charity.register_tools(mcp)
  • Prompt template that references charity_search as step 1 in a due diligence workflow.
    def charity_due_diligence(charity_name: str) -> str:
        return (
            f"Run a due diligence check on UK charity '{charity_name}'. "
            "Use the available tools:\n"
            "1. charity_search — find the charity and confirm the charity number\n"
            "2. charity_profile — fetch the full record including trustees, "
            "income/expenditure, and insolvency flags\n"
            "3. gazette_insolvency — search by the charity name for any insolvency notices\n"
            "Summarise findings including financial health and governance flags."
        )
Behavior5/5

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

Discloses that the upstream endpoint returns all results in one shot with client-side pagination via offset/limit, adding behavioral context beyond the readOnlyHint annotation.

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?

Four concise sentences, front-loaded with core purpose, no fluff, and each sentence serves a distinct purpose.

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?

Covers all essential aspects: purpose, return fields, pagination behavior, and sibling tool guidance. With a complete input schema and output schema present, no gaps remain.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema already has 100% parameter descriptions; the description adds extra context like 'raise to 100 for bulk views' for the limit parameter and explains offset/limit pagination mechanism.

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 the Charity Commission register by name or keyword, returns specific fields, and distinguishes from the sibling charity_profile tool by directing users to use it for full details.

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?

It explicitly says when to use (search by name/keyword) and when to switch to charity_profile for details, providing clear guidance on tool selection.

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