search_people
Find and retrieve contact information for professionals by searching Apollo.io's database using criteria like job title, company domain, location, and seniority level.
Instructions
Search for people/contacts in Apollo.io database.
This tool allows you to search for people by job title, seniority, company domain, location, and other criteria. Returns contact information and employment details.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| request | Yes |
Implementation Reference
- src/apollo_mcp_server.py:89-98 (schema)Pydantic model defining the input schema/validation for the search_people tool.class PeopleSearchRequest(BaseModel): """Request model for people search.""" q_organization_domains: Optional[str] = Field(None, description="Organization domains (newline separated)") person_titles: Optional[List[str]] = Field(None, description="Job titles to search for") person_seniorities: Optional[List[str]] = Field(None, description="Seniority levels") organization_locations: Optional[List[str]] = Field(None, description="Organization locations") organization_num_employees_ranges: Optional[List[str]] = Field(None, description="Employee count ranges") page: int = Field(1, description="Page number for pagination") per_page: int = Field(10, description="Number of results per page")
- src/apollo_mcp_server.py:153-185 (handler)The core handler function for the 'search_people' tool. Decorated with @mcp.tool() for automatic registration in FastMCP. Handles input parsing, schema validation with PeopleSearchRequest, API call to Apollo.io's /v1/mixed_people/search endpoint, and error handling.@mcp.tool() async def search_people(request: Union[Dict[str, Any], str]) -> Dict[str, Any]: """ Search for people/contacts in Apollo.io database. This tool allows you to search for people by job title, seniority, company domain, location, and other criteria. Returns contact information and employment details. """ endpoint = "/v1/mixed_people/search" # Handle both JSON string and dict inputs if isinstance(request, str): try: request = json.loads(request) except json.JSONDecodeError as e: return {"error": f"Invalid JSON in request: {str(e)}"} # Create and validate request object from dictionary try: people_request = PeopleSearchRequest(**request) except Exception as e: return {"error": f"Invalid request parameters: {str(e)}"} # Convert request to dict and remove None values search_params = {k: v for k, v in people_request.dict().items() if v is not None} try: result = await apollo_client.make_request("POST", endpoint, data=search_params) return result except httpx.HTTPStatusError as e: return {"error": f"API request failed: {e.response.status_code} {e.response.text}"} except Exception as e: return {"error": f"Request failed: {str(e)}"}
- src/apollo_mcp_server.py:153-153 (registration)The @mcp.tool() decorator registers the search_people function as an MCP tool in the FastMCP server.@mcp.tool()