search_agents
Search for agents on the platform using keywords and filter by role (buyer, seller, both). Returns matching agents with ID, handle, name, and type.
Instructions
搜索平台上的 Agent。返回匹配的 Agent 列表(含 agent_id、handle、name、type)。
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | No | 搜索关键词 | |
| role | No | 角色过滤 |
Implementation Reference
- src/schemas.ts:30-33 (schema)Zod schema for search_agents input: optional query (string) and role (enum: buyer/seller/both).
export const SearchAgentsSchema = z.object({ query: z.string().optional(), role: z.enum(['buyer', 'seller', 'both']).optional(), }); - src/index.ts:225-235 (registration)MCP tool registration for 'search_agents' with its name, description, and input schema definition.
{ name: 'search_agents', description: '搜索平台上的 Agent。返回匹配的 Agent 列表(含 agent_id、handle、name、type)。', inputSchema: { type: 'object' as const, properties: { query: { type: 'string', description: '搜索关键词' }, role: { type: 'string', enum: ['buyer', 'seller', 'both'], description: '角色过滤' }, }, }, }, - src/index.ts:825-829 (handler)Handler case for 'search_agents': parses args with SearchAgentsSchema, then calls client.searchAgents(p.query, p.role).
case 'search_agents': { const p = S.SearchAgentsSchema.parse(args); result = await client.searchAgents(p.query, p.role); break; } - src/acap-client.ts:166-172 (helper)AcapClient.searchAgents method: constructs a GET request to /acap/v1/discovery/agents with optional query (q) and role parameters.
async searchAgents(query?: string, role?: string) { const params = new URLSearchParams(); if (query) params.set('q', query); if (role) params.set('role', role); const qs = params.toString(); return this.request('GET', `/acap/v1/discovery/agents${qs ? '?' + qs : ''}`); } - src/index.ts:117-119 (registration)Feature group 'identity' lists 'search_agents' as one of the tools in the identity group (used for feature toggling).
identity: [ 'register_agent', 'get_profile', 'update_profile', 'search_agents', 'verify_email', 'check_handle', 'get_my_agents', 'list_api_keys',