send_message
Send messages to A2A agents and receive immediate status or pending task IDs for background result retrieval.
Instructions
Sends a message to an agent and returns the task status.
This function initiates a task with an agent. It will return quickly.
If the agent responds within 5 seconds, the final result is returned.
Otherwise, a 'pending' status is returned, and the gateway continues to fetch the result in the background. Use the 'get_task_result' tool with the returned 'task_id' to check for completion.
Args: agent_url (str): The URL of the registered A2A agent. message (str): The text message to send. session_id (Optional[str]): An optional identifier for conversation context. ctx (Context): The MCP context for logging.
Returns: Dict[str, Any]: A dictionary representing the task. It will contain the final result if completed quickly, or a pending status if the agent takes longer to respond.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| agent_url | Yes | ||
| message | Yes | ||
| session_id | No |