discover_agents
List registered agents with computed presence (online/offline) and operator status, filterable by role, to select routing targets or confirm availability before assigning work.
Instructions
List every registered agent with computed presence + operator-controlled status.
When to use: pick a routing target by role (e.g., 'any builder'), confirm an expected agent is online before sending it work, or surface the agent fleet to a dashboard. For periodic team rollups use get_standup instead, it bundles agents + recent activity in one call.
Behavior: pure read; never mutates last_seen (v1.3 presence-integrity fix). Optionally filters by role. The returned status (online | stale | offline) is computed from last_seen deltas; the returned agent_status (idle | working | blocked | waiting_user | stale | offline | abandoned | closed) is operator-controlled via set_status. Token hashes are stripped, has_token: boolean only.
Returns: { agents: AgentWithStatus[], count: number, filter: { role } | 'none' }. Ordered by last_seen DESC.
Errors: RATE_LIMITED. (No auth required, this surface is intentionally observable for orchestration.)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| role | No | Filter by role | |
| view | No | ADR-0002: 'list' (default) = flat agent list (unchanged). 'topology' = the live team grouped by coordination class (orchestrator/builder/advisory/auditor), flat within each; transient + unclassified + dead/terminal agents are excluded from the who's-who. | list |
| agent_token | No | Your agent token (from register_agent response). Optional here — also resolvable from RELAY_AGENT_TOKEN env or X-Agent-Token header. |