Skip to content

Commit 874dfdf

Browse files
authored
fix(a2a_client): Update tool description to reduce hallucinations (#263)
1 parent b3f743f commit 874dfdf

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/strands_tools/a2a_client.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,8 @@ async def a2a_discover_agent(self, url: str) -> dict[str, Any]:
139139
Discover an A2A agent and return its agent card with capabilities.
140140
141141
This function fetches the agent card from the specified A2A agent URL
142-
and caches it for future use.
142+
and caches it for future use. Use this when you need to discover a new
143+
agent that is not in the known agents list.
143144
144145
Args:
145146
url: The base URL of the A2A agent to discover
@@ -212,9 +213,14 @@ async def a2a_send_message(
212213
"""
213214
Send a message to a specific A2A agent and return the response.
214215
216+
IMPORTANT: If the user provides a specific URL, use it directly. If the user
217+
refers to an agent by name only, use a2a_list_discovered_agents first to get
218+
the correct URL. Never guess, generate, or hallucinate URLs.
219+
215220
Args:
216221
message_text: The message content to send to the agent
217-
target_agent_url: The URL of the target A2A agent
222+
target_agent_url: The exact URL of the target A2A agent
223+
(user-provided URL or from a2a_list_discovered_agents)
218224
message_id: Optional message ID for tracking (generates UUID if not provided)
219225
220226
Returns:

0 commit comments

Comments
 (0)