enrich_organization
Enrich company data by domain to obtain detailed organization information including industry, employee count, and contact details.
Instructions
Enrich organization/company information.
This tool enriches company data based on domain, returning detailed information about the organization including industry, employee count, contact info, and more.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| request | Yes |
Implementation Reference
- src/apollo_mcp_server.py:223-255 (handler)The main handler function for the 'enrich_organization' tool, decorated with @mcp.tool() for registration. It parses the request, validates using OrganizationEnrichmentRequest schema, calls the Apollo.io /v1/organizations/enrich API endpoint, and returns the enriched organization data or error.@mcp.tool() async def enrich_organization(request: Union[Dict[str, Any], str]) -> Dict[str, Any]: """ Enrich organization/company information. This tool enriches company data based on domain, returning detailed information about the organization including industry, employee count, contact info, and more. """ endpoint = "/v1/organizations/enrich" # 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: org_request = OrganizationEnrichmentRequest(**request) except Exception as e: return {"error": f"Invalid request parameters: {str(e)}"} params = {"domain": org_request.domain} try: result = await apollo_client.make_request("GET", endpoint, params=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:112-114 (schema)Pydantic model defining the input schema for the enrich_organization tool, requiring a 'domain' field.class OrganizationEnrichmentRequest(BaseModel): """Request model for organization enrichment.""" domain: str = Field(..., description="Company domain to enrich")