[FEATURE] Add AnySearchTool to crewai-tools (one endpoint: general web + vertical structured search)
Feature Area
Integration with external tools
Is your feature request related to a an existing bug? Please link it here.
NA — not a bug.
Describe the solution you'd like
Add a search tool to crewai-tools, AnySearchTool, alongside the existing provider tools (BraveSearchTool, EXASearchTool, LinkupSearchTool, TavilySearchTool, SerperDevTool).
AnySearch is a single API that serves both general web search and vertical, structured retrieval. What makes it worth a tool rather than just "another search backend":
- One endpoint, both modes. A plain query behaves like general web search. Adding a vertical selector plus typed parameters returns structured data instead of links — e.g. live quotes (
finance.quotewithtype=crypto|stock|forex|commodity|index|etf), real code across public repos (code.snippetwithlang/repo/path), citations by DOI (academic.citation), or CVE details (security.vuln). No second vendor and no second credential. - The vertical catalog is discoverable at runtime. A companion tool returns the valid sub-domains and their parameter definitions for any domain, and that call does not consume search quota. So the exposed tool surface stays small and does not need a release every time a vertical is added.
- Region routing. One parameter picks the
cnorintlresult universe, instead of two integrations. - Optional credential. Calls work without an API key on an anonymous, per-IP rate-limited tier. That is a genuine difference from the existing providers — and it means the tool's tests can run in CI without any secret configured.
Proposed shape (matching the existing tools' conventions):
class AnySearchTool(BaseTool):
name: str = "AnySearch"
description: str = "..."
env_vars: list[EnvVar] = Field(default_factory=lambda: [
EnvVar(name="ANYSEARCH_API_KEY", description="API key for AnySearch", required=False),
])
def __init__(self, api_key: str | None = None) -> None: ...
def _run(self, query: str, domain: str | None = None, sub_domain: str | None = None,
sub_domain_params: dict | None = None, max_results: int = 10,
format: Literal["json", "markdown"] = "json") -> dict[str, Any]: ...Note required=False on the env var: it is deliberate, not an oversight. The tool must work keyless, and the docstring should state that the paid quota is only needed for higher rate limits.
Files we would touch, following tools/linkup/ as the template:
| Path | Purpose |
|---|---|
lib/crewai-tools/src/crewai_tools/tools/anysearch/anysearch_search_tool.py |
implementation |
lib/crewai-tools/src/crewai_tools/tools/anysearch/__init__.py |
package export |
lib/crewai-tools/src/crewai_tools/tools/anysearch/README.md |
usage, credentials, connection notes |
lib/crewai-tools/src/crewai_tools/tools/anysearch/assets/icon.png |
icon |
lib/crewai-tools/src/crewai_tools/__init__.py |
top-level import + __all__ entry |
lib/crewai-tools/tests/tools/anysearch_search_tool_test.py |
tests |
docs/edge/en/tools/search-research/anysearchtool.mdx |
docs page |
If you would prefer, we can split the optional AnySearchExtractTool (URL → clean content) and AnySearchSubDomainsTool (catalog lookup) into a follow-up PR rather than the first one — your call.
No new runtime dependency is needed: requests is already a crewai-tools dependency, so the implementation adds none. Combined with the optional credential, this means the PR touches only the tool, its test and its docs page, and the test runs in CI without any secret.
Describe alternatives you've considered
- MCP only, no tool. We are aware CrewAI supports remote MCP servers and that AnySearch is reachable that way today — we tested it (
Agent(mcps=[MCPServerHTTP(url="https://api.anysearch.com/mcp", ...)])loads our four tools, and a real search call returns results). We still think a first-party tool is worth having, and the repo already shows why: Exa is available both through MCP (your docs usehttps://mcp.exa.ai/mcpas the remote-server example) and asEXASearchToolincrewai-tools. MCP availability has not been treated as a reason to skip a provider tool, and we would like AnySearch to be consistent with that. Concretely, the tool adds: discoverability for users browsingcrewai-tools/docs instead of needing the endpoint URL; control over thedescriptionthe model routes on, which is where the "call the catalog tool before a vertical search, never guess parameters" convention has to live; and usability in deployments where MCP clients are disabled or egress is allowlisted. - A community package on PyPI instead. Keeps it out of the release, so users have to discover it separately, and it drifts from the other search providers. We would rather own a PR here.
- A generic HTTP tool. Pushes schema and prompt design onto every user, and loses the structured vertical parameters.
Additional context
API base https://api.anysearch.com. Endpoints used by the proposed tool:
| Endpoint | Purpose |
|---|---|
POST /v1/search |
unified search — query (required), tag ({domain}.{sub_domain}, e.g. code.doc), params (tag-specific object), zone (cn|intl), language, max_results (1–10), format (json|markdown) |
GET /v1/sub-domains?domain=code&domain=finance |
valid sub-domains and their parameter definitions; does not consume search quota |
POST /v1/extract |
public URL → cleaned content (HTML/text/JSON/Markdown) |
Response envelope: code, message, request_id, data.results[] (title, url, snippet, content) and data.metadata (total_results, search_time_ms). Errors are classified by HTTP status (400/401/402/403/415/422/429/502) with a stable error_code where applicable.
Verified against the live API while preparing this: an anonymous POST /v1/search returns code: 0 with real results, and GET /v1/sub-domains returns the catalog with parameter definitions without a key. The domains currently exposed include academic, business, code, energy, environment, finance, gaming, general, health, ip, legal, resource, security, social_media, travel and others.
Not a duplicate of the existing search tools: the others are general web search (Brave, Exa, Tavily, Serper, Linkup) or single-purpose verticals. This one covers general and vertical from the same call, with the vertical surface discoverable at runtime rather than frozen into the schema.
We are happy to adjust naming, scope, or the tool's description wording to match your conventions.
Willingness to Contribute
Yes, I'd be happy to submit a pull request
Source: crewAIInc/crewAI