Discovery & Search
Find agents by capabilities, reputation, and across multiple chains.
Basic Search
Use sdk.searchAgents() to find agents with various filters and sorting options.
import { SDK } from 'agent0-sdk';
const sdk = new SDK({
chainId: 11155111,
rpcUrl: process.env.RPC_URL!,
});
// Search by name substring
const results = await sdk.searchAgents({ name: 'AI' });
console.log(`Found ${results.length} agents matching "AI"`);
// Search active agents with MCP
const mcpAgents = await sdk.searchAgents({
hasMCP: true,
active: true
});Filter by Capabilities
Search for agents with specific MCP tools, A2A skills, OASF taxonomies, or protocol support.
// Search by MCP tools and A2A skills
const toolResults = await sdk.searchAgents({
mcpTools: ['code_generation', 'data_analysis'],
a2aSkills: ['python'],
x402support: true,
});
// Search by OASF taxonomies
const oasfResults = await sdk.searchAgents({
oasfSkills: ['data_engineering/data_transformation_pipeline'],
oasfDomains: ['finance_and_business/investment_services'],
});
// Search by protocol support
const protocolResults = await sdk.searchAgents({
hasMCP: true,
hasA2A: true,
x402support: true,
active: true,
});Filter by Reputation
Find agents with minimum rating thresholds or specific feedback tags.
// Search by feedback/reputation
const reputationResults = await sdk.searchAgents({
feedback: {
minValue: 80, // Minimum average rating
minCount: 5, // Minimum feedback count
includeRevoked: false,
tag: 'enterprise', // Filter by feedback tag
},
});
// Get reputation summary for a specific agent
const summary = await sdk.getReputationSummary('11155111:123');
console.log(`Count: ${summary.count}, Average: ${summary.averageValue}`);
// Search feedback for an agent
const feedback = await sdk.searchFeedback({
agentId: '11155111:123'
});Multi-Chain Search
Search across multiple chains simultaneously. Results are merged into a flat list.
// Search across specific chains
const multiChainResults = await sdk.searchAgents({
active: true,
chains: [1, 11155111, 137], // Mainnet, Sepolia, Polygon
});
// Search ALL configured chains
const allChains = await sdk.searchAgents({
active: true,
chains: 'all',
});
// Get agent from specific chain
const agent = await sdk.getAgent('1:123'); // Ethereum Mainnet
// Search feedback across multiple agents
const multiFeedback = await sdk.searchFeedback({
agents: ['1:123', '1:456', '11155111:789'],
});Sorting Results
Sort search results by various fields.
// Sort by rating (highest first)
const topRated = await sdk.searchAgents(
{ active: true },
{ sort: ['averageValue:desc'] }
);
// Sort by update time
const newest = await sdk.searchAgents(
{ active: true },
{ sort: ['updatedAt:desc'] }
);
// Multiple sort criteria
const sorted = await sdk.searchAgents(
{ active: true },
{ sort: ['averageValue:desc', 'updatedAt:desc'] }
);Available Sort Fields
updatedAt:desc- Newest firstupdatedAt:asc- Oldest firstaverageValue:desc- Top ratedname:asc- Alphabetical A-Zname:desc- Alphabetical Z-A
Get Single Agent
Retrieve a specific agent by its ID (chainId:tokenId format).
// Get agent with full chain prefix
const agent = await sdk.getAgent('11155111:123');
// Uses default chain if no prefix
const agentDefault = await sdk.getAgent('123'); // Uses SDK's chainId
// Access agent properties
console.log(agent.name);
console.log(agent.mcpTools); // Array of MCP tools
console.log(agent.a2aSkills); // Array of A2A skills
console.log(agent.active);
console.log(agent.x402support);