defineAgent.
Define an agent
Every capability is passed as a handle, so Cargo deploys dependencies first and injects their uuids:agents/sdr.ts
Anatomy
| Field | Role | Learn more |
|---|---|---|
systemPrompt | The agent’s mission and constraints | Prompt |
capabilities | Built-in LLM features (web search, memory, …) | Native LLM capabilities |
tools / connectorActions | Operations the agent can invoke | Tools & actions |
models | Structured data it can read/write | Resources & context |
subAgents | Specialist agents it can delegate to | this page |
connector / languageModel / maxSteps / evaluator | LLM provider and behavior | Advanced settings |
tools, subAgents, and connectorActions accept the same per-call options — pass a bare handle, or { ref, name, description, isBulkAllowed, waitUntilFinished } when you need to tune the call (connector actions omit waitUntilFinished).

