Ask an agent
askDelegate a prompt to a coding agent and wait for its reply, session ID, and usage. Supports multiple agents, models, images, and session continuation.
Instructions
Run a prompt on an agent and wait for the answer (minutes). Returns reply, session_id, usage.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| agent | Yes | Agent name from list_agents, e.g. 'codex' or 'claude'. | |
| model | No | Model ID from list_models. | |
| images | No | Absolute image paths to attach (agents with supports.images). | |
| prompt | Yes | Instructions for the agent. | |
| workdir | No | Absolute project directory. Default: first trusted workspace. | |
| add_dirs | No | Extra absolute directories the agent may use. | |
| session_id | No | Continue this session (returned by earlier calls). | |
| output_schema | No | Optional JSON Schema; the reply is returned parsed as `structured`. | |
| fallback_agents | No | Agents to try in order if this one is out of quota or unavailable. | |
| permission_mode | No |