agents_ask
Send a message to an AI agent and get its response.
The agent runs with its configured prompt, tools, and knowledge. Use this to test agents or have them process a task.
Returns: {status: 'replied'|'silent', response_text, messages[], full_reply, model_used, tokens_*, send_mode, execution_mode, tool_calls[]}. tool_calls[] is the per-tool trace in call order — each {tool, success, error, duration_ms} — so you can see which tool the agent ran and why it failed (e.g. a workbench script error) directly from this response, no trace lookup needed. messages[] carries each messages.send invocation the agent made (text, subject, reply_to_message_id, timestamp, message_id, attachments=[{file_id,name,mime}]). full_reply concatenates text only — attachment-only sends show up in messages but not full_reply. status='silent' iff both response_text is empty AND messages is empty.
Execution may take 10-60s depending on agent complexity. For runs that may exceed ~2 minutes (heavy multi-step agents), pass background=true: the call returns immediately with status='started' and the run continues server-side, detached from this connection — poll agents.traces_list / agents.trace_get for the outcome and agents.list_drafts for produced drafts.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| message | Yes | Message/goal to send to the agent | |
| agent_id | Yes | ID of the AI agent to ask | |
| send_mode | No | Send mode for the agent run: 'draft' = create drafts, 'auto' = send directly. Defaults to the agent's configured default_send_mode. Does NOT change execution_mode — that is fixed by the agent's config. | |
| background | No | Run detached from this MCP connection. Returns immediately with status='started'; the run survives client timeouts and disconnects (up to 15 min). Poll agents.traces_list for the outcome. Use for runs expected to exceed ~2 minutes — a synchronous call is cancelled when the MCP request dies. OMIT to run synchronously and get the answer in this call (the default). | |
| in_workspace | No | Run this one call in this workspace id instead of the session's. Nothing is stored; other sessions are not affected. | |
| attachment_file_ids | No | File ids to attach to the message, as a customer would have sent them. Use this to test how the agent handles a photo or a document: a vision-capable model receives the image itself, a text-only one receives a one-line description of it. |