defineAgent:
agents/sdr.ts
tools, connectorActions, and subAgents all accept the same per-call options — { name, description, isBulkAllowed, waitUntilFinished } — wrapped around a bare handle ({ ref, …options }) or, for connector actions, alongside integration / actionSlug. The description is the AI contract — the agent reads it to decide when to call the action.
Connect an integration with
defineConnector before
referencing its actions, and see Tools for building the
tools you pass in. Run cargo-ai cdk types so
actionSlug values autocomplete from the real registry.How actions work
When an agent receives a task, it:- Analyzes the goal and available actions
- Selects the appropriate action(s) based on their descriptions
- Executes the action with the right inputs
- Uses the output to continue reasoning or complete the task
The action’s description is critical. The agent reads this description to
decide when and how to use the action. Write descriptions that clearly explain
what the action does and when to use it.
Configuring an action
Description (the AI contract)
This plain-language description tells the agent:- What the action does
- When to use it
- What inputs it expects
Fixed vs. agent-decided inputs
By default the agent decides every input field of a connector action at runtime, from conversation context and the action’s description. To lock a field to a fixed value, set it in the action’sconfig — anything you put there is sent as-is and never left to the agent:
config or agent-decided.
Bulk execution
SetisBulkAllowed: true when the agent should apply the action across multiple records in a single run. Useful for batch operations like:
- Enriching a list of companies
- Updating multiple CRM records
- Sending notifications to several recipients
Waiting for completion
waitUntilFinished (default true) blocks the agent until the action finishes so it can use the result. Set it to false for fire-and-forget calls — e.g. a Slack notification the agent doesn’t need to read back.
Common action types
| Category | Examples | Typical use |
|---|---|---|
| Enrichment | Clearbit, Apollo, FullEnrich | Gather company or contact data |
| CRM | Salesforce, HubSpot, Attio | Create/update records, log activities |
| Communication | Slack, Email, Outreach | Send messages, add to sequences |
| Data lookup | Internal APIs, SQL queries | Retrieve custom data from your systems |
MCP servers
Cargo agents support the Model Context Protocol (MCP) — an open standard for connecting AI models to external actions and data sources. Declare the servers an agent can call withmcpClients; Cargo discovers and registers their tools automatically:
disabledToolSlugs to hide individual tools from the agent, and authentication to pass an OAuth token set for servers that require one (or null for unauthenticated servers). In the UI, the same thing is configured by pasting the server URL on the agent’s Actions tab.
This is the agent consuming external MCP servers. To expose your own
Cargo tools and agents as an MCP server, see
MCP servers.
Best practices
Write clear descriptions
The agent relies on descriptions to choose actions. Be specific about what the
action does and what it returns.
Name actions descriptively
Use names like
Enrich-Company or Slack-Notify-Rep instead of generic
names like Action1.Handle failures gracefully
In your agent’s instructions, specify what to do if an action call fails
(retry, skip, report error).
Limit scope
Only give agents access to the actions they need. Fewer actions = faster, more
accurate action selection.
Next steps
Connectors
Connect integrations with defineConnector before referencing their actions.
Tools
Build reusable tools with defineTool to pass into an agent.

