ask
Sends a question to another agent and waits for its reply in one call, returning the response or null on timeout. Use it to get a direct answer without polling.
Instructions
Ask one agent a question and wait for its answer in one call: sends body to the agent to, as send_message does, and holds the call until that agent answers it with send_message and in_reply_to set to the question's id. Returns id (the question's message id) and reply: the earliest such reply, shaped as read_inbox returns a message and marked read, or null if none came within timeout_seconds or the call was cancelled. With reply null, a later answer arrives as an ordinary message: find it with read_inbox or read_conversation by its inReplyTo, the question's id; message_status with the id says only whether the question was read. It checks about once a second; a check that finds the database busy counts as no reply that time. To answer a question someone asks you, call send_message with in_reply_to set to the question's id, so that their ask sees it. 'all' and a person are refused, and nothing is sent. Calls held at once are capped together with wait_for_mail, over HTTP also with the server's GET /wait requests and over stdio for the whole process; past the cap it fails at once and sends nothing, so try again shortly. If your agent is removed while you wait, it fails as not registered. Requires register first.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | Yes | The agent to ask, by name. Not 'all' or a person. | |
| body | Yes | The question, at most 4000 characters. | |
| timeout_seconds | No | How long to wait for the reply, in seconds: default 50, at most 240. |