Skip to main content
Glama
FromSmall2Big

Apollo.io MCP Server

search_accounts

Find companies in Apollo.io by name, location, or employee count to identify prospects and gather account information for sales and marketing.

Instructions

Search for accounts/companies in Apollo.io database.

This tool allows you to search for companies by name, location, employee count, and other criteria. Useful for finding potential prospects and account information.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
requestYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The core handler function for the 'search_accounts' tool. It handles input parsing and validation, calls the Apollo.io API endpoint /v1/accounts/search, and returns the results or error messages.
    @mcp.tool()
    async def search_accounts(request: Union[Dict[str, Any], str]) -> Dict[str, Any]:
        """
        Search for accounts/companies in Apollo.io database.
        
        This tool allows you to search for companies by name, location, employee count,
        and other criteria. Useful for finding potential prospects and account information.
        """
        endpoint = "/v1/accounts/search"
        
        # 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:
            account_request = AccountSearchRequest(**request)
        except Exception as e:
            return {"error": f"Invalid request parameters: {str(e)}"}
        
        # Convert request to dict and remove None values
        search_params = {k: v for k, v in account_request.dict().items() if v is not None}
        
        try:
            result = await apollo_client.make_request("POST", endpoint, data=search_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)}"}
  • Pydantic model that defines and validates the input schema for the search_accounts tool.
    class AccountSearchRequest(BaseModel):
        """Request model for account search."""
        q_organization_name: Optional[str] = Field(None, description="Company name to search for")
        organization_locations: Optional[List[str]] = Field(None, description="List of locations to filter by")
        organization_num_employees_ranges: Optional[List[str]] = Field(None, description="Employee count ranges")
        industry_tag_ids: Optional[List[str]] = Field(None, description="Industry tag IDs")
        page: int = Field(1, description="Page number for pagination")
        per_page: int = Field(25, description="Number of results per page")
  • The @mcp.tool() decorator registers the search_accounts function as an MCP tool.
    @mcp.tool()
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions search capabilities by name, location, employee count, and other criteria, but doesn't describe pagination, rate limits, authentication requirements, result format, or what 'other criteria' might include. For a search tool with zero annotation coverage, this leaves significant behavioral gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately concise with two sentences. The first sentence establishes the core purpose, and the second adds context about search criteria and use cases. No wasted words, though it could be slightly more structured by explicitly listing parameters.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (search functionality), no annotations, and an output schema exists (so return values are documented elsewhere), the description is minimally adequate. It covers what the tool does and some use cases, but lacks parameter details and behavioral context that would make it fully complete for an AI agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, and the description provides no information about the single 'request' parameter. It mentions search criteria like name, location, and employee count, but doesn't explain how to structure these in the request parameter. With low coverage and no parameter guidance in the description, this fails to compensate for the schema gap.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Search for accounts/companies in Apollo.io database' with specific resources (accounts/companies) and a database context. It distinguishes from siblings like 'search_people' by focusing on companies, but doesn't explicitly differentiate from 'get_account_by_id' or 'bulk_enrich_organizations' which also involve account data.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides implied usage guidance: 'Useful for finding potential prospects and account information' suggests prospecting use cases. However, it doesn't explicitly state when to use this vs. alternatives like 'get_account_by_id' (for known IDs) or 'search_people' (for individuals), nor does it mention exclusions or prerequisites.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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