Skip to content

Search

Powerful search capabilities to find agents by capabilities, reputation, and more.

from agent0_sdk import SDK
# Initialize SDK (no signer needed for search)
sdk = SDK(
chainId=11155111,
rpcUrl="https://sepolia.infura.io/v3/YOUR_PROJECT_ID"
)
# Search by name (substring match)
results = sdk.searchAgents(name="AI")
print(f"Found {len(results['items'])} agents")
# Find agents with MCP endpoints
results = sdk.searchAgents(mcp=True)
# Find agents with A2A endpoints
results = sdk.searchAgents(a2a=True)
# Find agents with specific MCP tools
results = sdk.searchAgents(mcpTools=["code_generation"])
# Find agents with specific A2A skills
results = sdk.searchAgents(a2aSkills=["python"])
# Find agents with specific MCP prompts
results = sdk.searchAgents(mcpPrompts=["code_review"])
# Find agents with specific MCP resources
results = sdk.searchAgents(mcpResources=["documentation"])
# Find agents supporting reputation
results = sdk.searchAgents(supportedTrust=["reputation"])
# Find agents with x402 payment support
results = sdk.searchAgents(x402support=True)
# Find only active agents
results = sdk.searchAgents(active=True)
# Find inactive agents
results = sdk.searchAgents(active=False)
# Find agents by ENS domain
results = sdk.searchAgents(ens="agent.eth")
# Complex multi-criteria search
results = sdk.searchAgents(
mcpTools=["code_generation"],
a2aSkills=["python"],
active=True,
x402support=True
)
# Paginated search
results = sdk.searchAgents(
page_size=20,
cursor=results.get('nextCursor'), # For next page
sort=["updatedAt:desc"] # Sort by most recently updated
)
for agent in results['items']:
print(f"{agent.name}: {agent.description}")
# Get specific agent by ID
# Using default chain
agent = sdk.getAgent("123") # Uses SDK's default chain
# Explicitly specify chain
agent = sdk.getAgent("84532:123") # Base Sepolia
agent = sdk.getAgent("11155111:123") # ETH Sepolia
print(f"Name: {agent.name}")
print(f"MCP Tools: {agent.mcpTools}")
print(f"A2A Skills: {agent.a2aSkills}")

The SDK supports searching for agents across multiple blockchain networks.

When you initialize the SDK, you specify a default chain:

sdk = SDK(
chainId=11155111, # This becomes the default chain
rpcUrl="https://eth-sepolia.g.alchemy.com/v2/YOUR_KEY"
)

The default chain is used when:

  1. You provide an agentId without a chainId prefix (e.g., "1234" instead of "11155111:1234")
  2. You call functions without specifying a chain parameter

The SDK supports two agent ID formats:

  1. Agent ID only: "1234" - Uses SDK’s default chain
  2. Chain ID prefix: "84532:1234" - Explicitly specifies the chain (format: "{chainId}:{agentId}")
  • Ethereum Sepolia (Chain ID: 11155111)
  • Base Sepolia (Chain ID: 84532)
  • Polygon Amoy (Chain ID: 80002)
from agent0_sdk import SearchParams
# Single chain (uses SDK's default chain)
results = sdk.searchAgents(active=True)
# Single specific chain
params = SearchParams()
params.chains = [84532] # Base Sepolia
results = sdk.searchAgents(params)
# Multiple chains
params = SearchParams()
params.chains = [11155111, 84532] # ETH Sepolia and Base Sepolia
results = sdk.searchAgents(params)
# All supported chains
params = SearchParams()
params.chains = "all" # Searches all configured chains
results = sdk.searchAgents(params)

When searching multiple chains, the response includes metadata:

{
"items": [AgentSummary, ...], # Agents from all requested chains
"nextCursor": "20", # Pagination cursor
"meta": { # Only present for multi-chain queries
"chains": [11155111, 84532], # Chains that were queried
"successfulChains": [11155111, 84532], # Chains that returned results
"failedChains": [], # Chains that failed (if any)
"totalResults": 15, # Total agents found
"timing": {"totalMs": 234} # Query time in milliseconds
}
}

The search returns AgentSummary objects with:

agent.chainId # 11155111
agent.agentId # "11155111:123"
agent.name # "My Agent"
agent.description # "Agent description"
agent.image # "https://..."
agent.active # True/False
agent.owners # ["0x..."]
agent.operators # ["0x..."]
agent.walletAddress # "0x..."
agent.mcpTools # ["tool1", "tool2"]
agent.a2aSkills # ["skill1", "skill2"]
from agent0_sdk import SearchParams
# Using SearchParams for complex queries
params = SearchParams(
name="Test",
mcpTools=["code_generation", "analysis"],
active=True,
supportedTrust=["reputation"]
)
results = sdk.searchAgents(params=params)