Skip to main content
Glama
paulieb89

UK Legal Research MCP Server

Search Parliamentary Committees

committees_search_committees
Read-onlyIdempotent

Search or list UK parliamentary select committees by name, house, or active status. Returns committee names, house, and active indicator.

Instructions

Search or list UK parliamentary select committees.

Returns committee names, house, and active status. Use committees_get_committee with the committee ID for membership detail.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
paramsYesCommitteeSearchInput with optional query, house, active_only, limit.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryNoName substring filter applied, or None
houseNoHouse filter applied, or None
active_onlyYesWhether results were restricted to currently active committees
totalYesNumber of committees returned in this call
committeesNoMatching committees. Use committees_get_committee for membership detail.

Implementation Reference

  • The register_tools function registers the tool via @mcp.tool with name='search_committees', and the handler function committees_search_committees is defined and decorated here.
    def register_tools(mcp: FastMCP) -> None:
    
        @mcp.tool(
            name="search_committees",
            annotations={"title": "Search Parliamentary Committees", "readOnlyHint": True, "destructiveHint": False, "idempotentHint": True, "openWorldHint": True},
        )
        async def committees_search_committees(params: CommitteeSearchInput, ctx: Context) -> CommitteeSearchResult:
            """Search or list UK parliamentary select committees.
    
            Returns committee names, house, and active status.
            Use committees_get_committee with the committee ID for membership detail.
    
            Args:
                params: CommitteeSearchInput with optional query, house, active_only, limit.
            """
            client: httpx.AsyncClient = ctx.lifespan_context["http"]
            qp: dict = {"Take": params.limit}
            if params.active_only:
                qp["CommitteeStatus"] = "Current"
            if params.house:
                qp["House"] = HOUSE_MAP.get(params.house)
    
            resp = await client.get(f"{COMMITTEES_BASE}/Committees", params=qp)
            resp.raise_for_status()
            data = resp.json()
    
            items = data.get("items", data.get("results", data)) if isinstance(data, dict) else data
            if not isinstance(items, list):
                items = []
    
            committees: list[CommitteeSummary] = []
            for item in items:
                name = item.get("name", "Unknown")
                if params.query and params.query.lower() not in name.lower():
                    continue
                cid = item.get("id", 0)
                committees.append(CommitteeSummary(
                    id=cid,
                    name=name,
                    house=_parse_house(item.get("house")),
                    is_active=True if params.active_only else None,
                    url=f"https://committees.parliament.uk/committee/{cid}/",
                ))
    
            return CommitteeSearchResult(
                query=params.query,
                house=params.house,
                active_only=params.active_only,
                total=len(committees),
                committees=committees,
            )
  • The actual handler for committees_search_committees — fetches committees from the Parliament API, filters client-side by name query, and returns CommitteeSearchResult.
    async def committees_search_committees(params: CommitteeSearchInput, ctx: Context) -> CommitteeSearchResult:
        """Search or list UK parliamentary select committees.
    
        Returns committee names, house, and active status.
        Use committees_get_committee with the committee ID for membership detail.
    
        Args:
            params: CommitteeSearchInput with optional query, house, active_only, limit.
        """
        client: httpx.AsyncClient = ctx.lifespan_context["http"]
        qp: dict = {"Take": params.limit}
        if params.active_only:
            qp["CommitteeStatus"] = "Current"
        if params.house:
            qp["House"] = HOUSE_MAP.get(params.house)
    
        resp = await client.get(f"{COMMITTEES_BASE}/Committees", params=qp)
        resp.raise_for_status()
        data = resp.json()
    
        items = data.get("items", data.get("results", data)) if isinstance(data, dict) else data
        if not isinstance(items, list):
            items = []
    
        committees: list[CommitteeSummary] = []
        for item in items:
            name = item.get("name", "Unknown")
            if params.query and params.query.lower() not in name.lower():
                continue
            cid = item.get("id", 0)
            committees.append(CommitteeSummary(
                id=cid,
                name=name,
                house=_parse_house(item.get("house")),
                is_active=True if params.active_only else None,
                url=f"https://committees.parliament.uk/committee/{cid}/",
            ))
    
        return CommitteeSearchResult(
            query=params.query,
            house=params.house,
            active_only=params.active_only,
            total=len(committees),
            committees=committees,
        )
  • CommitteeSearchInput — input schema with optional query, house filter, active_only boolean, and limit.
    class CommitteeSearchInput(BaseModel):
        model_config = ConfigDict(str_strip_whitespace=True, extra="forbid")
    
        query: str | None = Field(None, description=(
            "Search term for committee names, e.g. 'defence' or 'treasury'. "
            "Filtered client-side against committee names. Omit to list all committees."
        ), max_length=300)
        house: Literal["Commons", "Lords", "Joint"] | None = Field(None, description="Filter by house.")
        active_only: bool = Field(True, description="If true, only return currently active committees.")
        limit: int = Field(
            100,
            ge=1,
            le=500,
            description=(
                "Maximum committees to return. Default 100 comfortably covers all "
                "currently-active UK select committees. Raise only for historical sweeps."
            ),
        )
  • CommitteeSearchResult — output model for the search results, including committees list.
    class CommitteeSearchResult(BaseModel):
        """Result of a committees_search_committees call."""
    
        model_config = ConfigDict(str_strip_whitespace=True)
    
        query: str | None = Field(None, description="Name substring filter applied, or None")
        house: str | None = Field(None, description="House filter applied, or None")
        active_only: bool = Field(..., description="Whether results were restricted to currently active committees")
        total: int = Field(..., description="Number of committees returned in this call")
        committees: list[CommitteeSummary] = Field(
            default_factory=list,
            description="Matching committees. Use committees_get_committee for membership detail.",
        )
  • Module init that creates the FastMCP instance and calls register_tools, along with namespace mounting instructions.
    """committees sub-module — UK Parliament select committees and evidence."""
    
    from fastmcp import FastMCP
    from fastmcp.server.middleware.caching import ResponseCachingMiddleware, CallToolSettings
    
    from .tools import register_tools
    
    committees_mcp = FastMCP(
        name="committees",
        instructions=(
            "Search UK parliamentary select committees and their evidence submissions. "
            "Use committees_search_committees to find committees by name, house, or status. "
            "Use committees_get_committee to get detail including current membership. "
            "Use committees_search_evidence to find oral and written evidence for a committee. "
            "All data from committees-api.parliament.uk. No authentication required."
        ),
    )
    
    committees_mcp.add_middleware(ResponseCachingMiddleware(call_tool_settings=CallToolSettings(ttl=3600)))
    
    register_tools(committees_mcp)
    
    __all__ = ["committees_mcp"]
Behavior4/5

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

Annotations already provide readOnlyHint, destructiveHint, idempotentHint. Description adds that it returns committee names, house, and active status, and mentions client-side filtering for query. No contradictions.

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 concise sentences plus a line about return fields. Front-loaded with purpose, 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?

Given the output schema exists, the description adequately covers what the tool does: search/list committees, return names/house/status, and points to another tool for details. Complete for a list/search tool.

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

Parameters4/5

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

Schema coverage is 100%, so baseline is 3. Description adds value by explaining 'Omit to list all committees' for query and clarifying default limit covers all active committees.

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 'Search or list UK parliamentary select committees.' It specifies the verb (search/list) and resource (committees), and distinguishes from sibling tools like committees_get_committee and committees_search_evidence.

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?

Explicitly says 'Use committees_get_committee with the committee ID for membership detail,' providing a clear alternative for a different task. Also implies usage for listing or searching, with no exclusions.

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-legal-mcp'

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