search_people_by_name
Find people by matching any part of their first, last, or preferred name with a case-insensitive substring search.
Instructions
Case-insensitive substring search over firstName/lastName/preferredName across all people. Pulls the full people list then filters client-side.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | ||
| limit | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- humaans_mcp/server.py:79-94 (handler)The actual handler for the 'search_people_by_name' tool. It performs a case-insensitive substring search over firstName/lastName/preferredName/middleName by fetching all people and filtering client-side, returning up to `limit` results.
async def search_people_by_name(query: str, limit: int = 20) -> list[dict[str, Any]]: """Case-insensitive substring search over firstName/lastName/preferredName across all people. Pulls the full people list then filters client-side.""" q = query.strip().lower() if not q: return [] all_people = await client().list_all("/people") matches = [] for p in all_people: hay = " ".join( str(p.get(k) or "") for k in ("firstName", "lastName", "preferredName", "middleName") ).lower() if q in hay: matches.append(p) if len(matches) >= limit: break return matches - humaans_mcp/server.py:78-78 (registration)The tool is registered with the MCP server via the @mcp.tool() decorator on line 78.
@mcp.tool() - humaans_mcp/server.py:79-79 (schema)Input parameters: query (str, required) and limit (int, default 20). Output type: list[dict[str, Any]]. The docstring also serves as the tool description exposed via MCP.
async def search_people_by_name(query: str, limit: int = 20) -> list[dict[str, Any]]: - humaans_mcp/client.py:57-74 (helper)The `list_all` helper method on HumaansClient is used by the handler to fetch all people from the /people endpoint with pagination handled transparently.
async def list_all( self, path: str, filters: dict[str, Any] | None = None, cap: int = MAX_LIST_ALL, ) -> list[dict[str, Any]]: collected: list[dict[str, Any]] = [] skip = 0 while len(collected) < cap: page = await self.list_page(path, filters=filters, limit=PAGE_SIZE, skip=skip) items = page.get("data") if isinstance(page, dict) else page if not items: break collected.extend(items) if len(items) < PAGE_SIZE: break skip += PAGE_SIZE return collected[:cap]