Skip to main content
Glama

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
NameRequiredDescriptionDefault
account_stage_idsNo
pageNo
per_pageNo
sort_by_fieldNo

Implementation Reference

  • 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)}"}
  • The @mcp.tool() decorator registers the search_opportunities function as an MCP tool.
    @mcp.tool()

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/FromSmall2Big/Apollo-MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server