search_opportunities
Search and filter sales opportunities in Apollo.io to track deals and manage pipeline with customizable sorting options.
Instructions
Search for opportunities in Apollo.io.
This tool searches for sales opportunities with filtering and sorting options. Useful for tracking deals and pipeline management.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page | No | ||
| per_page | No | ||
| account_stage_ids | No | ||
| sort_by_field | No |
Implementation Reference
- src/apollo_mcp_server.py:403-435 (handler)The handler function for the 'search_opportunities' tool. It is registered via the @mcp.tool() decorator and implements the logic to search Apollo.io opportunities using the API endpoint /v1/opportunities/search.@mcp.tool() async def search_opportunities( page: int = 1, per_page: int = 25, account_stage_ids: Optional[List[str]] = None, sort_by_field: Optional[str] = None ) -> Dict[str, Any]: """ Search for opportunities in Apollo.io. This tool searches for sales opportunities with filtering and sorting options. Useful for tracking deals and pipeline management. """ endpoint = "/v1/opportunities/search" data = { "page": page, "per_page": per_page } if account_stage_ids: data["account_stage_ids"] = account_stage_ids if sort_by_field: data["sort_by_field"] = sort_by_field try: result = await apollo_client.make_request("POST", endpoint, data=data) 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)}"}