Search
Powerful search capabilities to find agents by capabilities, reputation, and more.
Basic Search
Section titled “Basic Search”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")import { SDK } from 'agent0-sdk';
// Initialize SDK (no signer needed for search)const sdk = new SDK({ chainId: 11155111, rpcUrl: 'https://sepolia.infura.io/v3/YOUR_PROJECT_ID',});
// Search by name (substring match) - async in TypeScriptconst results = await sdk.searchAgents({ name: 'AI' });console.log(`Found ${results.items.length} agents`);Search Parameters
Section titled “Search Parameters”By Endpoints
Section titled “By Endpoints”# Find agents with MCP endpointsresults = sdk.searchAgents(mcp=True)
# Find agents with A2A endpointsresults = sdk.searchAgents(a2a=True)// Find agents with MCP endpointsconst results = await sdk.searchAgents({ mcp: true });
// Find agents with A2A endpointsconst results = await sdk.searchAgents({ a2a: true });By Capabilities
Section titled “By Capabilities”# Find agents with specific MCP toolsresults = sdk.searchAgents(mcpTools=["code_generation"])
# Find agents with specific A2A skillsresults = sdk.searchAgents(a2aSkills=["python"])
# Find agents with specific MCP promptsresults = sdk.searchAgents(mcpPrompts=["code_review"])
# Find agents with specific MCP resourcesresults = sdk.searchAgents(mcpResources=["documentation"])// Find agents with specific MCP toolsconst results = await sdk.searchAgents({ mcpTools: ['code_generation'] });
// Find agents with specific A2A skillsconst results = await sdk.searchAgents({ a2aSkills: ['python'] });
// Find agents with specific MCP promptsconst results = await sdk.searchAgents({ mcpPrompts: ['code_review'] });
// Find agents with specific MCP resourcesconst results = await sdk.searchAgents({ mcpResources: ['documentation'] });By Trust Models
Section titled “By Trust Models”# Find agents supporting reputationresults = sdk.searchAgents(supportedTrust=["reputation"])
# Find agents with x402 payment supportresults = sdk.searchAgents(x402support=True)// Find agents supporting reputationconst results = await sdk.searchAgents({ supportedTrust: ['reputation'] });
// Find agents with x402 payment supportconst results = await sdk.searchAgents({ x402support: true });By Status
Section titled “By Status”# Find only active agentsresults = sdk.searchAgents(active=True)
# Find inactive agentsresults = sdk.searchAgents(active=False)// Find only active agentsconst results = await sdk.searchAgents({ active: true });
// Find inactive agentsconst results = await sdk.searchAgents({ active: false });By ENS
Section titled “By ENS”# Find agents by ENS domainresults = sdk.searchAgents(ens="agent.eth")// Find agents by ENS domainconst results = await sdk.searchAgents({ ens: 'agent.eth' });Combined Search
Section titled “Combined Search”# Complex multi-criteria searchresults = sdk.searchAgents( mcpTools=["code_generation"], a2aSkills=["python"], active=True, x402support=True)// Complex multi-criteria searchconst results = await sdk.searchAgents({ mcpTools: ['code_generation'], a2aSkills: ['python'], active: true, x402support: true,});Pagination and Sorting
Section titled “Pagination and Sorting”# Paginated searchresults = 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}")// Paginated searchconst results = await sdk.searchAgents( {}, ['updatedAt:desc'], // Sort by most recently updated 20, // pageSize results.nextCursor // For next page);
for (const agent of results.items) { console.log(`${agent.name}: ${agent.description}`);}Get Single Agent
Section titled “Get Single Agent”# Get specific agent by ID# Using default chainagent = sdk.getAgent("123") # Uses SDK's default chain
# Explicitly specify chainagent = sdk.getAgent("84532:123") # Base Sepoliaagent = sdk.getAgent("11155111:123") # ETH Sepolia
print(f"Name: {agent.name}")print(f"MCP Tools: {agent.mcpTools}")print(f"A2A Skills: {agent.a2aSkills}")// Get specific agent by ID (async in TypeScript)// Using default chainconst agent = await sdk.getAgent('123'); // Uses SDK's default chain
// Explicitly specify chainconst agent = await sdk.getAgent('84532:123'); // Base Sepoliaconst agent = await sdk.getAgent('11155111:123'); // ETH Sepolia
console.log(`Name: ${agent.name}`);console.log(`MCP Tools: ${agent.mcpTools?.join(', ')}`);console.log(`A2A Skills: ${agent.a2aSkills?.join(', ')}`);Multi-Chain Search
Section titled “Multi-Chain Search”The SDK supports searching for agents across multiple blockchain networks.
Default Chain
Section titled “Default Chain”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")const sdk = new SDK({ chainId: 11155111, // This becomes the default chain rpcUrl: 'https://eth-sepolia.g.alchemy.com/v2/YOUR_KEY'});The default chain is used when:
- You provide an
agentIdwithout achainIdprefix (e.g.,"1234"instead of"11155111:1234") - You call functions without specifying a chain parameter
Agent ID Format
Section titled “Agent ID Format”The SDK supports two agent ID formats:
- Agent ID only:
"1234"- Uses SDK’s default chain - Chain ID prefix:
"84532:1234"- Explicitly specifies the chain (format:"{chainId}:{agentId}")
Supported Networks
Section titled “Supported Networks”- Ethereum Sepolia (Chain ID:
11155111) - Base Sepolia (Chain ID:
84532) - Polygon Amoy (Chain ID:
80002)
Multi-Chain Agent Search
Section titled “Multi-Chain Agent Search”from agent0_sdk import SearchParams
# Single chain (uses SDK's default chain)results = sdk.searchAgents(active=True)
# Single specific chainparams = SearchParams()params.chains = [84532] # Base Sepoliaresults = sdk.searchAgents(params)
# Multiple chainsparams = SearchParams()params.chains = [11155111, 84532] # ETH Sepolia and Base Sepoliaresults = sdk.searchAgents(params)
# All supported chainsparams = SearchParams()params.chains = "all" # Searches all configured chainsresults = sdk.searchAgents(params)// Single chain (uses SDK's default chain)const results = await sdk.searchAgents({ active: true });
// Single specific chainconst results = await sdk.searchAgents({ active: true, chains: [84532] // Base Sepolia});
// Multiple chainsconst results = await sdk.searchAgents({ active: true, chains: [11155111, 84532] // ETH Sepolia and Base Sepolia});
// All supported chainsconst results = await sdk.searchAgents({ active: true, chains: 'all' // Searches all configured chains});Multi-Chain Response Format
Section titled “Multi-Chain Response Format”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 }}{ items: AgentSummary[], // Agents from all requested chains nextCursor?: string, // Pagination cursor meta?: { // Only present for multi-chain queries chains: number[], // Chains that were queried successfulChains: number[], // Chains that returned results failedChains: number[], // Chains that failed (if any) totalResults: number, // Total agents found timing: { totalMs: number, // Total query time in milliseconds averagePerChainMs?: number // Average time per chain } }}Agent Summary Properties
Section titled “Agent Summary Properties”The search returns AgentSummary objects with:
agent.chainId # 11155111agent.agentId # "11155111:123"agent.name # "My Agent"agent.description # "Agent description"agent.image # "https://..."agent.active # True/Falseagent.owners # ["0x..."]agent.operators # ["0x..."]agent.walletAddress # "0x..."agent.mcpTools # ["tool1", "tool2"]agent.a2aSkills # ["skill1", "skill2"]import type { AgentSummary } from 'agent0-sdk';
agent.chainId // 11155111agent.agentId // "11155111:123"agent.name // "My Agent"agent.description // "Agent description"agent.image // "https://..." | undefinedagent.active // true | falseagent.owners // ["0x..."]agent.operators // ["0x..."]agent.walletAddress // "0x..." | undefinedagent.mcpTools // ["tool1", "tool2"] | undefinedagent.a2aSkills // ["skill1", "skill2"] | undefinedAdvanced Search
Section titled “Advanced Search”from agent0_sdk import SearchParams
# Using SearchParams for complex queriesparams = SearchParams( name="Test", mcpTools=["code_generation", "analysis"], active=True, supportedTrust=["reputation"])
results = sdk.searchAgents(params=params)import { SDK } from 'agent0-sdk';import type { SearchParams } from 'agent0-sdk';
// Using SearchParams for complex queriesconst params: SearchParams = { name: 'Test', mcpTools: ['code_generation', 'analysis'], active: true, supportedTrust: ['reputation'],};
const results = await sdk.searchAgents(params);