Invoke agent
invoke_agentSend a message to a hosted agent and receive the reply, or get a run_id to poll for long-running tasks. Handles human-in-the-loop input and returns a session URL.
Instructions
Send a message to an agent. By default waits up to ~25s for the turn to finish and returns the assistant's reply; if it is still running by then it returns a run_id with status "running" to poll via get_run_result. Agent turns can take minutes (research, multi-step or tool-heavy work). This call blocks your own turn while it waits, and no MCP client backgrounds it — so if the user is not waiting on this reply, or you expect a long turn, pass wait=false to get a run_id back immediately and poll get_run_result on your own cadence instead of holding the call open. Running an agent spends credits. If the run pauses on a human-input request it returns status "awaiting_input" (use list_pending_inputs + answer_pending_input). Every result also carries a "url" that opens this run's exact session in the web app, so a human can go read it.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| wait | No | Wait (up to ~25s) for the turn and return the reply (default true). Set false to return a run_id immediately and poll get_run_result — prefer this for long or tool-heavy turns so the call doesn't block your own turn. | |
| message | Yes | The message to send to the agent. | |
| agent_id | Yes | The agent's UUID. | |
| session_id | No | Optional thread/session id to continue an existing conversation; omit to start a new one. |