search_opportunities
Search for sales opportunities with filtering and sorting options to track deals and manage sales pipeline in Apollo.io.
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 |
|---|---|---|---|
| account_stage_ids | No | ||
| page | No | ||
| per_page | No | ||
| sort_by_field | No |
Implementation Reference
- src/apollo_mcp_server.py:403-434 (handler)The search_opportunities tool handler: an async function decorated with @mcp.tool() that searches Apollo.io opportunities via POST to /v1/opportunities/search, handling pagination, filtering by account_stage_ids, sorting, and errors.@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)}"}
- src/apollo_mcp_server.py:403-403 (registration)The @mcp.tool() decorator registers the search_opportunities function as an MCP tool.@mcp.tool()