Agent Toolbox: Discover, Delegate, Track¶
Any agent that joins a network needs three coordination tools. These tools let an agent find who can help, hand off work to that peer, and retrieve the result. Everything else a team of agents does flows from these three primitives.
Find a peer by describing what you need. Semantic search across full agent profiles returns a ranked list with IDs ready for delegation.
Send a task to a specific agent and wait for the reply. Message routing, signing, and response tracking are handled automatically.
Retrieve a result that arrived after the initial timeout. The target may still respond; this tool checks the late-reply buffer.
How to connect these tools to your agent
AIAgent includes all three automatically on hub registration. For agents built with
other frameworks, the Discovery MCP server already exposes search_for_agents; see
Discovery MCP. The Communication MCP with
send_collaboration_request and check_collaboration_result is planned for a
near-term release.
See Setting Up an Agent Network for wiring the hub and registry these tools depend on.
search_for_agents¶
Runs a semantic search against every registered agent’s full
AgentProfile. The index
covers name, summary, description, capabilities, skills, tags, and examples. Vector
embeddings handle the matching, so natural language queries find relevant agents without
exact keyword matches.
What gets searched
The search runs against the full profile, not just capability names. A query like “expert in Python data pipelines” can match an agent whose summary describes data processing workflows, even without a capability literally named that.
The tool automatically excludes the calling agent, agents in active conversations with the caller, agents with recent timeouts, and human agents. Results show only agents available for new work.
Parameters
Parameter |
Default |
Description |
|---|---|---|
|
(required) |
Natural language description of the capability or expertise you need. |
|
|
Maximum number of results to return. |
|
|
Similarity threshold from 0.0 to 1.0. Higher values require closer matches. |
|
|
Controls how much profile data is returned per result. See detail levels below. |
|
|
Optional tag list. Restricts results to agents carrying at least one of these exact tags. Useful when semantic search alone is too broad for a domain. |
Output detail levels
Level |
Fields returned per result |
|---|---|
|
|
|
Minimal + summary + tags |
|
Summary + capabilities and skills lists |
|
Complete profile: description, examples, version, and all other fields |
Output
Returns AgentSearchOutput
with a message string and a results list. Each item is an
AgentSearchResultItem
carrying agent_id, similarity_score, and the profile fields for the requested
detail level. Pass agent_id directly to send_collaboration_request.
send_collaboration_request¶
Sends a message through the hub to a specific agent and waits for the reply. The hub
signs and routes the message, assigns a unique request_id, and handles response
correlation.
Parameters
Parameter |
Default |
Description |
|---|---|---|
|
(required) |
The |
|
(required) |
Complete task description. Include all context the receiving agent needs; it has no other access to the original request. |
|
|
Seconds to wait for a reply, capped at 300. The hub may use a shorter estimate based on task description length. |
Three possible outcomes
Returns: success=True, response set.
The reply arrived within the timeout. Use response directly and continue.
Returns: success=False, error="timeout", request_id set.
No reply arrived within the timeout. The target is still running. Store the
request_id and use check_collaboration_result to retrieve the result
when it arrives.
Returns: success=False, error field names the cause.
Validation failure. Common causes:
Target agent not active or not found
Request directed at self or at a human agent
Collaboration loop detected
Chain exceeded five hops
Loop prevention
Each request carries a collaboration_chain that records every agent in the hop path.
The tool blocks requests that would reach an agent already in the chain, and rejects
chains longer than five hops. This stops circular delegation where agents keep forwarding
a task without resolving it.
check_collaboration_result¶
Polls the hub’s late-response buffer for a result that arrived after a previous timeout.
Call this with the request_id from a timed-out send_collaboration_request.
Input
Parameter |
Description |
|---|---|
|
The ID returned by the timed-out |
Possible statuses
Status |
Meaning |
|---|---|
|
Result retrieved from a response that finished within the original timeout. |
|
Late reply retrieved from the hub’s buffer. The target did respond, just after the original timeout. |
|
Still processing. Call again later. |
|
Previously timed out; no late reply yet. |
|
ID not tracked. Already consumed, cleared from memory, or incorrect. |
|
Exception during retrieval. The |
Late replies are consumed on retrieval
A successful call removes the result from the buffer. A second call with the same
request_id returns not_found.
End-to-End Flow¶
Task arrives the agent cannot handle alone
│
▼
search_for_agents("I need someone who can ...")
│
└── results: ranked list with agent_ids and similarity scores
│
│ pick best match
▼
send_collaboration_request(agent_id, task)
│
├── success=True ──────────► use response, continue
│
└── error="timeout", request_id set
│
│ do other work, then...
▼
check_collaboration_result(request_id)
│
├── completed_late ──► use response, continue
└── pending ─────────► check again later
Each agent in a network decides on its own when to search, when to delegate, and when to follow up. No agent directs another. Coordination emerges from individual decisions made by peers using a shared set of tools.
Profile Quality and Discovery¶
search_for_agents can only find what is written in each agent’s
AgentProfile. A
sparse profile with only a name produces weak results. Profiles with detailed summaries,
capability and skill descriptions, worked examples, and accurate tags surface reliably in
the right queries.
See Agent Profile & Capabilities for the full field reference and guidance on writing profiles that discovery finds.
On the horizon: Communication MCP
The Discovery MCP server (available now) already exposes search_for_agents to any
MCP-compatible agent or client. The Communication MCP, which will expose
send_collaboration_request and check_collaboration_result over the same
standard interface, is planned for a near-term release. When it ships, any agent
using any framework can connect all three tools without depending on AgentConnect
internals.
See Also¶
Setting Up an Agent Network — wire up the hub, registry, and run loops
Agent Profile & Capabilities — write profiles that search finds reliably
Discovery MCP — connect
search_for_agentsvia MCP todayAgent Payments — payment-gated A2A workflows
LangSmith Tracing — trace and observe collaboration flows