list_agents
Browse and filter AI agents, MCP servers, CLI tools, and skills from the A2ASearch directory by type, popularity, or recency.
Instructions
List agents from A2ASearch, optionally filtered by type. Use this to browse top agents by category.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| type | No | Filter by type (optional — omit for all types) | |
| sort | No | Sort order: 'stars' for most popular, 'new' for recently added | stars |
| limit | No | Number of results (1-20, default 10) |
Implementation Reference
- index.js:69-95 (schema)Definition of the list_agents tool including name, description, and inputSchema.
{ name: "list_agents", description: "List agents from A2ASearch, optionally filtered by type. " + "Use this to browse top agents by category.", inputSchema: { type: "object", properties: { type: { type: "string", enum: ["MCP Server", "CLI Tool", "AI Coding Agent", "Agent Skill", "A2A Agent"], description: "Filter by type (optional — omit for all types)", }, sort: { type: "string", enum: ["stars", "new"], description: "Sort order: 'stars' for most popular, 'new' for recently added", default: "stars", }, limit: { type: "number", description: "Number of results (1-20, default 10)", default: 10, }, }, }, }, - index.js:189-220 (handler)Implementation of the list_agents tool handler, which fetches agent data from an API and formats the output.
if (name === "list_agents") { const { type, sort = "stars", limit = 10 } = args; const params = new URLSearchParams({ per_page: String(Math.min(20, Math.max(1, limit))), sort, }); if (type) params.set("type", type); const res = await fetch(`${API_BASE}/agents?${params}`); if (!res.ok) throw new Error(`API error: ${res.status}`); const data = await res.json(); const label = type ? `${type}s` : "agents"; const sortLabel = sort === "stars" ? "by stars" : "recently added"; return { content: [ { type: "text", text: `Top ${data.data.length} ${label} ${sortLabel} (${data.pagination.total} total)\n\n` + data.data .map( (a, i) => `${i + 1}. **${a.name}** — ${a.description?.slice(0, 80) || "No description"}\n` + ` ⭐ ${a.stars?.toLocaleString() || 0} | ${a.agentCardUrl}` ) .join("\n"), }, ], }; }