enrich_person
Enhance person profiles by retrieving contact details like email addresses and phone numbers from Apollo.io's database to support sales and marketing activities.
Instructions
Enrich a person's information and reveal contact details.
This tool enriches person data and can reveal email addresses and phone numbers. The more information provided, the higher the match likelihood.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| request | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/apollo_mcp_server.py:188-220 (handler)The core handler function for the 'enrich_person' tool, decorated with @mcp.tool() for automatic MCP registration. It parses and validates input using PersonEnrichmentRequest Pydantic model, constructs API parameters, calls the Apollo.io /v1/people/match endpoint, and handles responses or errors.
@mcp.tool() async def enrich_person(request: Union[Dict[str, Any], str]) -> Dict[str, Any]: """ Enrich a person's information and reveal contact details. This tool enriches person data and can reveal email addresses and phone numbers. The more information provided, the higher the match likelihood. """ endpoint = "/v1/people/match" # 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: person_request = PersonEnrichmentRequest(**request) except Exception as e: return {"error": f"Invalid request parameters: {str(e)}"} # Convert request to dict and remove None values enrich_params = {k: v for k, v in person_request.dict().items() if v is not None} try: result = await apollo_client.make_request("POST", endpoint, data=enrich_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:100-109 (schema)Pydantic model defining the input schema and validation for the enrich_person tool, specifying optional fields like names, email, organization details, LinkedIn URL, and flags for revealing contacts.
class PersonEnrichmentRequest(BaseModel): """Request model for person enrichment.""" first_name: Optional[str] = Field(None, description="Person's first name") last_name: Optional[str] = Field(None, description="Person's last name") email: Optional[str] = Field(None, description="Person's email address") organization_name: Optional[str] = Field(None, description="Company name") domain: Optional[str] = Field(None, description="Company domain") linkedin_url: Optional[str] = Field(None, description="LinkedIn profile URL") reveal_personal_emails: bool = Field(False, description="Whether to reveal personal emails") reveal_phone_number: bool = Field(False, description="Whether to reveal phone numbers")