> ## Agent Instructions > If you are an AI coding agent operating Cargo, install the agent skills first: paste `Install Cargo by following https://api.getcargo.io/INSTALL.md` into your session, or run `npx skills add getcargohq/cargo-skills`. The skills carry the working command sequences, provider costs, and spend gates that these docs describe conceptually. > The skills index at https://raw.githubusercontent.com/getcargohq/cargo-skills/main/llms.txt lists every skill, recipe, and provider playbook individually. Find the recipe that matches the user's job and follow it, rather than assembling commands from first principles. > Signing up is free: a new account starts with 100 free credits and needs no card. `cargo-ai login --email you@company.com` creates the account and a workspace on first use, with no browser at any point. Tell the user this before asking them to sign up. > Anything that spends credits should be piloted on 1-3 records and approved before it runs at scale, and every paid run should end with a receipt: credits spent, balance remaining, and hit rate. # Advanced settings Source: https://docs.getcargo.ai/agents/advanced LLM selection, behavioral tuning, structured output, evaluators, triggers, and heartbeats — everything else on defineAgent. Beyond the prompt and actions, `defineAgent` carries the agent's LLM binding and its behavioral settings: ```ts agents/qualifier.ts theme={null} export const qualifier = defineAgent("qualifier", { connector: openai, // the LLM provider connector languageModel: "gpt-4o", // the model slug systemPrompt: "Qualify leads against our ICP.", temperature: 0.2, // 0.0–0.2 deterministic, 0.7+ creative (default 0.2) maxSteps: 4, // reasoning-step budget (default 8) withReasoning: false, // extended thinking before acting (default false) output: { type: "text" }, // or a jsonSchema contract — see below evaluator: { rubric: "Did it correctly qualify the lead?", threshold: 0.8 }, triggers: [ { type: "cron", cron: "0 9 * * *", text: "Qualify yesterday's leads" }, ], }); ``` `connector` and `languageModel` are both required — `defineAgent` throws at `plan` time if either is missing. The connector's integration (OpenAI, Anthropic, …) determines which model slugs are valid. *** ## Coding agents A coding agent runs inside a sandbox with a cloned repository. Set `harness` to the runtime (e.g. `claudeCode`, `cursor`) and `repository` to control what the sandbox clones. ### Automatic repository binding **Omit `repository`** and `plan`/`deploy` fill it from the checkout they run in — the `owner/name` of your git `origin`, the remote's default branch, and this project's path inside the repo — with the connector taken from the project's GitHub `defineConnector`: ```ts connectors/github.ts theme={null} export const github = defineConnector("github", { integration: "github", default: true, }); ``` ```ts agents/coder.ts theme={null} export const coder = defineAgent("coder", { harness: "claudeCode", systemPrompt: "Work on this repository.", // repository omitted → bound to this checkout's origin }); ``` Anything you declare wins, so a partial object is completed the same way and a full one is left alone. `plan` prints what it resolved (e.g. `agent:coder bound to acme/app#main in infra/`) and the resolved values are inside the content hash, so deploying the same code from a different repository is a real update. ### Edge cases | Checkout | Behavior | | :---------------------------------------------------------- | :-------------------------------------------------------------- | | **No GitHub remote** (GitLab origin, no origin, not a repo) | The agent stays unbound with an empty sandbox; `plan` says so | | **GitHub remote but no GitHub connector** | An error — add one with `cargo-ai project add connector/github` | ### Opting out Pass `repository: null` to force an unbound agent whatever the checkout says: ```ts theme={null} export const coder = defineAgent("coder", { harness: "claudeCode", systemPrompt: "General coding assistant.", repository: null, // explicitly unbound }); ``` **Breaking change** — a harness agent that omits `repository` in a project that has a GitHub connector was previously deployed unbound. It now binds on the next plan. Use `repository: null` to keep the old behaviour. *** ## Selecting a model The `connector` handle picks the provider; `languageModel` picks the model slug within it. Cargo supports the leading LLM providers — OpenAI, Anthropic, and Google Gemini among them — each behind its own [connector](/connectors/overview). List the model slugs a provider currently exposes rather than hardcoding from memory: ```bash theme={null} cargo-ai connection integration get openAi # → available actions and model slugs ``` | Task profile | Recommended approach | | :------------------------------------------------------- | :-------------------------------- | | **Complex analysis** (qualification, research synthesis) | The provider's most capable model | | **Simple classification** (routing, tagging) | A fast, low-cost model | | **High volume, low stakes** | Prioritize speed and cost | | **Low volume, high stakes** | Prioritize reasoning quality | Start with a powerful model during development to understand what's possible, then optimize for cost/speed once the agent is working well. *** ## Behavioral parameters ### Reasoning steps (`maxSteps`) The maximum number of logical sub-tasks the agent can perform to reach a conclusion. Defaults to `8`. | Setting | Effect | Use when | | :--------------- | :------------------------------- | :--------------------------------------- | | **Low (1-3)** | Fast, direct responses | Simple lookups, single-action tasks | | **Medium (4-6)** | Balanced reasoning | Most standard workflows | | **High (7+)** | Deep, multi-step problem solving | Complex research, multi-source synthesis | Higher reasoning steps increase latency and cost. Only increase if the agent is failing to complete tasks. ### Temperature Controls the creativity and variability of outputs. Defaults to `0.2`. | Temperature | Behavior | Best for | | :------------ | :--------------------------------- | :---------------------------------------------------- | | **0.0 - 0.2** | Deterministic, precise, consistent | Data extraction, classification, CRM updates | | **0.3 - 0.6** | Balanced creativity | General tasks, qualification, research | | **0.7 - 1.0** | Creative, varied | Copywriting, brainstorming, conversational engagement | ### Extended thinking (`withReasoning`) `withReasoning: true` lets the model think through the problem before acting — better on hard multi-step tasks, at the cost of latency and tokens. Defaults to `false`. *** ## Structured output By default an agent answers in free text (`output: { type: "text" }`). To make every final answer machine-parseable — for workflows or API consumers downstream — declare a JSON Schema contract: ```ts theme={null} output: { type: "jsonSchema", jsonSchema: { type: "object", properties: { score: { type: "string", enum: ["High", "Medium", "Low"] }, reasoning: { type: "string" }, }, required: ["score", "reasoning"], }, }, ``` *** ## Evaluator The `evaluator` is an LLM-as-judge that scores each of the agent's outputs against a natural-language rubric: ```ts theme={null} evaluator: { rubric: "Did it correctly qualify the lead, with evidence for the score?", threshold: 0.8, // passing bar in [0, 1] }, ``` Outputs scoring below `threshold` are flagged, so you can spot quality regressions without reading every conversation. Pair it with prompt iterations: change the `systemPrompt`, re-deploy, and compare evaluator pass rates. *** ## Triggers Agents normally respond to messages, but `triggers` make them start work on their own: ```ts theme={null} triggers: [ // On a schedule — `text` is the message the agent receives { type: "cron", cron: "0 9 * * *", text: "Qualify yesterday's inbound leads." }, // On a connector event (e.g. an incoming Slack message) agentConnectorTrigger({ connector: slack, config: { channel: "#inbound" } }), ], ``` A `connector` trigger references its connector by handle or `connectorRef(uuid)`; `config` is integration-specific. `agentConnectorTrigger` types that `config` against the integration's schema, which a bare object literal can't do — TypeScript won't infer a per-element type through an array. A `defineConnector` handle names its integration, so the helper reads it from there; pass `integration: "slack"` yourself when there's no handle to read it from, either because you're using `connectorRef(uuid)` or because the trigger names an integration with no specific connector. The bare form still works, with `config` left as a loose object: ```ts theme={null} { type: "connector", integration: "slack", connector: slack, config: { channel: "#inbound" } } ``` *** ## Heartbeat A `heartbeat` wakes the agent up on an interval inside an ongoing chat — useful for long-running missions that should make progress without a human prompting each turn: ```ts theme={null} heartbeat: { intervalMinutes: 30, // delay between heartbeat turns maxMessages: 40, // stop waking up once the chat has this many messages prompt: null, // message sent each turn; null = a generic "continue" }, ``` *** ## Optimizing for cost and speed Once your agent works correctly, consider: 1. **Reduce `maxSteps`** if tasks complete in fewer steps 2. **Try a faster model** and verify quality remains acceptable (the `evaluator` pass rate is the signal) 3. **Lower `temperature`** for more predictable outputs 4. **Limit resources** to reduce context size and processing time # Native LLM Capabilities Source: https://docs.getcargo.ai/agents/native-llm-capabilities Built-in features that enhance your Agent's reasoning, memory, and ability to interact with users and data. Capabilities are native features of the underlying LLM that extend what your Agent can do—beyond just processing instructions and calling actions. Enable them with the `capabilities` array on `defineAgent`. Each entry is a capability slug (or a `{ slug, config }` object for ones that take options): ```ts agents/researcher.ts theme={null} export const researcher = defineAgent("researcher", { connector: openai, languageModel: "gpt-4o", systemPrompt: "Research accounts and produce a shareable brief.", capabilities: ["webSearch", "memory", "document", "suggestedActions"], }); ``` The full set of slugs: `webSearch`, `memory`, `document` (Canvas), `suggestedActions`, `file`, `model`, `documentationSearch`, `sandbox`, and `context`. The sections below explain the most common ones and when to enable them. `file` and `model` are enabled automatically when files or models are attached to the Agent, so you rarely list them by hand. `file` covers listing, reading, searching and analysing files — analysing runs code over them in a sandbox, which is what the separate `codeInterpreter` slug used to do. *** ## Available capabilities ### Memory Memory allows Agents to retain and recall information across interactions, enabling personalization and continuity. | Memory type | Scope | Use case | | :------------------- | :----------------------- | :---------------------------------------------------------------------------------- | | **User Memory** | Persists per end-user | Stores preferences, past interactions, and personal context for tailored responses | | **Workspace Memory** | Shared across all Agents | Organizational knowledge like company policies, ICP definitions, or team guidelines | | **Agent Memory** | Current execution only | Short-term context including previous steps and action outputs within a single run | Use Workspace Memory for information that all Agents should know—like your ICP criteria or product positioning. *** ### Web Search Gives Agents access to real-time information from the internet. **When to enable:** * Account research requiring current market data * Validating company information that may have changed * Finding recent news, funding announcements, or leadership changes **Example query:** > "What is the latest funding round for Acme Corp?" *** ### Canvas Enables Agents to generate structured, shareable digital assets. The capability slug is `document` (surfaced as **Canvas** in the web app). **Supported outputs:** * Spreadsheets and CSV files * Text documents * Formatted reports **Example use case:** A user asks: *"Give me a list of CROs in San Francisco."* The Agent researches, compiles the data, and delivers a formatted spreadsheet—ready to download or share. *** ### Suggested Actions A proactive assistant that recommends the next best step after completing a task. **How it works:** 1. Agent completes the requested task 2. Analyzes what logical next steps might help the user 3. Offers actionable suggestions **Example:** After retrieving a list of contacts, the Agent suggests: > "Would you like me to add these contacts to Sequence XX?" > "Should I enrich these contacts with email addresses?" Suggested Actions keep workflows moving and help users discover capabilities they might not have thought to request. *** ## Enabling capabilities Toggle capabilities on or off based on your Agent's purpose: | Agent type | Recommended capabilities | | :--------------------------- | :------------------------- | | **Research Agent** | Memory, Web Search, Canvas | | **Qualification Agent** | Memory, Suggested Actions | | **CRM Updater** | Memory only | | **Conversational Assistant** | All capabilities | More capabilities = more complexity. Only enable what your Agent actually needs to avoid unpredictable behavior. # Overview Source: https://docs.getcargo.ai/agents/overview LLM-powered workers that reason, research, and act. Define them with defineAgent — wiring in tools, data models, sub-agents, and connector actions through one `uses` array. An **agent** is an AI worker that plans and executes multi-step tasks. Unlike a play (a fixed sequence), an agent reasons over its instructions and the tools, data, and sub-agents you give it. You define one with `defineAgent`. ## Define an agent Every capability is passed as a handle, so Cargo deploys dependencies first and injects their uuids: ```ts agents/sdr.ts theme={null} import { defineAgent } from "@cargo-ai/cdk"; import { hunter } from "../connectors/hunter"; import { openai } from "../connectors/openai"; import { contacts } from "../models/contacts"; import { enrich } from "../tools/enrich"; import { enricher } from "./enricher"; export const sdr = defineAgent("sdr", { connector: openai, // the LLM provider (not a `use`) languageModel: "gpt-4o", systemPrompt: "You qualify inbound leads, enrich missing contact info, and route hot leads to Slack.", maxSteps: 12, capabilities: ["webSearch", "memory"], // Everything the agent can call or read — one array, kind inferred per handle: uses: [ { ref: contacts, readOnly: true }, // a data model enrich, // a tool { ref: enricher, waitUntilFinished: true }, // a sub-agent hunter.actions.findEmail, // a connector action ], triggers: [{ type: "cron", cron: "0 9 * * *", text: "Daily qualification" }], evaluator: { rubric: "Did it correctly qualify the lead?", threshold: 0.8 }, }); ``` ## Anatomy | Field | Role | Learn more | | -------------------------------------------------------- | ------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------- | | `systemPrompt` | The agent's mission and constraints | [Prompt](/agents/prompt) | | `capabilities` | Built-in LLM features (web search, memory, …) | [Native LLM capabilities](/agents/native-llm-capabilities) | | `uses` | Everything it can invoke or read — tools, connector actions, sub-agents, data models | [Tools & actions](/agents/tools-and-actions), [Resources & context](/agents/resources-and-context) | | `connector` / `languageModel` / `maxSteps` / `evaluator` | LLM provider and behavior | [Advanced settings](/agents/advanced) | Each `uses` entry is a handle — its kind is read from the handle, so order doesn't matter. Pass a bare handle, or `{ ref, …options }` to tune it: tools / sub-agents / connector actions take `{ name, description, isBulkAllowed, config }`, with `waitUntilFinished` on tools and sub-agents only; a data model takes `{ readOnly, columns }`. A connector action is an action off a connector handle — `hunter.actions.findEmail`. ## Deploy and chat ```bash theme={null} cargo-ai project deploy cargo-ai ai agent list # → agentUuid cargo-ai ai chat create --agent-uuid --trigger '{"type":"draft"}' --name "My chat" cargo-ai ai message create --chat-uuid \ --parts '[{"type":"text","text":"Qualify acme.com"}]' --wait-until-finished ``` ## Where agents run Agents can be triggered from plays (scheduled or change-driven), Slack mentions, the Chrome extension, embedded chat, or a CRM button. Bundle them behind an [MCP server](/mcp-servers/overview) to expose them to external assistants. ## Using the UI Prefer to build visually? See [Using the UI](/agents/using-ui) for the Instructions / Actions / Resources walkthrough. Agents built in code and in the UI are interchangeable. # Prompt Source: https://docs.getcargo.ai/agents/prompt The systemPrompt is the foundation of an agent's behavior — its mission, approach, and constraints, versioned in code. The prompt tells your agent who it is, what it should do, and what it should avoid. A well-crafted prompt is the difference between an agent that delivers consistent, high-quality results and one that produces unpredictable outputs. The prompt is the `systemPrompt` field on `defineAgent`. Keep it in code so it's versioned and reviewable: ```ts agents/qualifier.ts theme={null} export const qualifier = defineAgent("qualifier", { connector: openai, languageModel: "gpt-4o", systemPrompt: `ROLE: You are a lead qualification specialist for Cargo. Evaluate inbound leads against our ICP and score their fit. BEHAVIOR: 1. Extract the company domain from the lead's email. 2. Use the enrichment action to gather firmographics. 3. Score the lead as "High", "Medium", or "Low" fit. 4. Return JSON: { score, reasoning, nextStep }. AVOIDANCES: - Do not qualify personal email domains (gmail, yahoo, …). - Never fabricate data — if enrichment fails, mark "Needs Review".`, uses: [enrich], }); ``` The rest of this page is guidance on writing that string well. ## The three components Every agent prompt consists of three sections: ### 1. Role / Purpose Defines **who the agent is** and **what it's trying to achieve**. This sets the primary context for the LLM. Keep this concise and focused on the end goal. One or two sentences is ideal. **Example:** ``` You are a lead qualification specialist for Cargo. Your job is to evaluate LinkedIn company URLs and determine if they match our Ideal Customer Profile. ``` ### 2. Behavior Outlines **how the agent should work** — the steps it takes, actions it uses, and the format of its output. This directly guides the agent's planning phase. **Example:** ``` 1. Use the "Company-Lookup" action to retrieve company data from the URL 2. Check the company against our ICP criteria in the Knowledge Base 3. Assign a qualification score: "High Fit", "Medium Fit", or "No Fit" 4. Provide a 2-3 sentence explanation of your reasoning ``` **Action selection tip**: Give each action a specific name and clear description. The agent uses these to decide which action to call and when. ### 3. Avoidances Establishes **what the agent must NOT do**. These guardrails prevent undesired actions and ensure compliance. **Example:** ``` - Never share proprietary ICP criteria with external parties - Do not make up information if a lookup fails—report the failure instead - Avoid overly casual language; maintain a professional tone ``` Avoidances are critical for security, compliance, and maintaining trust. Be explicit about sensitive data handling and edge cases. *** ## Best practices | Practice | Why it matters | | :----------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **Be specific** | Vague instructions lead to inconsistent results. Say "assign a score of 1-10" instead of "rate the lead" | | **Define output format** | Specify what the agent should return — or enforce it with `output: { type: "jsonSchema", … }` (see [Advanced settings](/agents/advanced#structured-output)) | | **List actions by name** | Reference the exact action names so the agent knows what's available | | **Handle edge cases** | Tell the agent what to do when data is missing or an action fails | | **Test iteratively** | Run test queries and refine the prompt based on actual outputs — an [`evaluator`](/agents/advanced#evaluator) can score outputs against a rubric automatically | *** ## Next steps Give the agent operations to invoke — tools, connector actions, sub-agents, MCP servers. Web search, memory, canvas, and the other built-in features. # Resources & context Source: https://docs.getcargo.ai/agents/resources-and-context Ground an agent in your data — models wired through defineAgent, files searched by vector similarity, and the context repository. Resources give your agent access to your organization's data — CRM records, knowledge bases, product databases, and more. This is called **RAG** (Retrieval-Augmented Generation): the agent retrieves relevant information before generating responses. In code, structured data is wired through the agent's `uses` array (alongside its tools and actions); unstructured content comes from [files](/files/overview) attached to the workspace: ```ts agents/support.ts theme={null} export const support = defineAgent("support", { connector: openai, languageModel: "gpt-4o", systemPrompt: "Answer using our CRM data and playbooks; never invent facts.", uses: [ { ref: deals, // a defineModel handle readOnly: true, // don't let it write back columns: ["name", "stage", "amount"], // narrow the surface }, ], }); ``` A data model in `uses` is a model handle (or `modelRef(uuid)`), bare or wrapped as `{ ref, readOnly, columns }` — its kind is read from the handle, so it sits in the same array as the agent's tools and actions. Without resources, an agent only knows its instructions and what web search returns. *** ## Types of resources There are two types of resources you can connect to your agent: | Type | Data format | Examples | | :----------------------------- | :---------------- | :----------------------------------------------- | | [**Models**](/models/overview) | Structured data | CRM objects, product databases, SQL tables | | [**Files**](/files/overview) | Unstructured data | PDFs, documents, transcripts, knowledge articles | ### Models Models connect your agent to **structured data** — tables with rows and columns. The agent queries this data using SQL, making it ideal for filtering, sorting, and aggregating records. **Best for:** * CRM Objects (HubSpot Deals, Salesforce Accounts, Attio Records) * Product Data (usage databases, analytics platforms) * Custom Databases (BigQuery, Snowflake) ### Files Files connect your agent to **unstructured data** — documents, PDFs, and text content. You select which files or folders to include, and the agent searches this content using vector similarity to find relevant information. **Best for:** * Knowledge Bases (Notion, Google Docs, uploaded files) * Playbooks, FAQs, and process documentation * Meeting transcripts and call notes When a workspace has a **context repository** configured, non-temporary files from the workspace Files library are also mirrored under `.files/` in that repo (preserving folder structure). That tree is **read-only** in the context runtime — agents can read mirrored files but cannot write, edit, or auto-commit changes under `.files/`. Update files in the Files library; Cargo syncs them into context. *** ## Configuring a model resource ### In code The `{ ref, …options }` wrapper covers the settings that matter most: | Option | Effect | | :--------- | :------------------------------------------------------------ | | `readOnly` | Block writes back to the model (defaults to `true` on agents) | | `columns` | Only expose these column slugs — less noise, better reasoning | ### In the UI The agent's Resources tab adds settings that don't have a code equivalent yet — configure these in the UI after deploying: | Setting | Description | | :------------- | :------------------------------------------------------------------------------------- | | **Query mode** | **SQL** (filter, sort, aggregate) or **Vector** (semantic similarity over text fields) | | **Filters** | Restrict which records the agent can access | | **Limit** | Maximum number of records returned per query | **SQL example:** > "Find all deals in the Discovery stage with value over \$50k" **Vector example:** > "Find companies with product descriptions similar to AI automation" UI-configured settings on a code-managed agent are overwritten if you later change that agent in code and re-deploy — see [Code and UI round-trips](/deploy/state-and-drift#code-and-ui-round-trips). *** ## Configuring files File resources are selected in the UI today (the agent's Resources tab): choose the files or folders to include, and the agent searches all selected content by vector similarity. The resource description guides how the agent interprets or prioritizes the content: ``` This folder contains our sales playbooks. Prioritize the objection handling guide when the user asks about pricing concerns. ``` Upload and organize the underlying files from code and the CLI — see [Files](/files/overview). *** ## Best practices Narrow down data access to what the agent actually needs. Less noise = better reasoning. Help the agent understand how to query your data and what matters most. For models, use SQL for filtering and aggregating, Vector for semantic search. Run test prompts to verify the agent retrieves the right data. *** ## Learn more Learn how to build and manage structured data models. Work with documents, PDFs, and unstructured content. # Tools & actions Source: https://docs.getcargo.ai/agents/tools-and-actions Give an agent callable operations — your tools, connector actions, sub-agents, and MCP servers — on defineAgent. Actions transform your agent from a reasoning engine into an action-taker. In code, you give an agent its callable capabilities — your tools, connector actions, and sub-agents — in one `uses` array on `defineAgent` (external MCP servers are a separate `mcpClients` field): ```ts agents/sdr.ts theme={null} export const sdr = defineAgent("sdr", { connector: openai, languageModel: "gpt-4o", systemPrompt: "Qualify inbound leads and route hot ones to Slack.", uses: [ enrich, // your tool (a defineTool handle) { ref: scoreLead, description: "Score ICP fit 1–10.", isBulkAllowed: true }, hunter.actions.findEmail, // an action off a connector handle { ref: researcher, waitUntilFinished: true }, // a specialist sub-agent ], // External MCP servers whose tools the agent can call (a separate field) mcpClients: [{ kind: "custom", name: "notion", url: "https://mcp.notion.com/mcp", authentication: null, disabledToolSlugs: [] }], }); ``` Each `uses` entry is a handle — bare, or `{ ref, …options }`. Tools, connector actions, and sub-agents share the options `{ name, description, isBulkAllowed, config }`, and tools and sub-agents take `waitUntilFinished` on top; the `description` is the AI contract — the agent reads it to decide when to call the action. A connector action is an action off a `defineConnector` handle: `hunter.actions.findEmail`. Connect an integration with [`defineConnector`](/connectors/overview) before referencing its actions, and see [Tools](/tools/overview) for building the tools you pass in. Run [`cargo-ai project types`](/get-started/project-layout) so a connector handle's action names (`hunter.`) autocomplete from the real registry. ## How actions work When an agent receives a task, it: 1. **Analyzes** the goal and available actions 2. **Selects** the appropriate action(s) based on their descriptions 3. **Executes** the action with the right inputs 4. **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 **Good example:** ``` "Enriches a company using its domain. Returns firmographic data including employee count, industry, funding, and tech stack. Use this when you need company information for qualification or research." ``` **Poor example:** ``` "Gets company data" ``` ### Fixed vs. agent-decided inputs By default the agent decides every input field of an action at runtime, from conversation context and the action's description. To lock a field to a fixed value, set it in the action's `config` — anything you put there is sent as-is and never left to the agent. This works for connector actions, tools, and sub-agents alike: ```ts theme={null} uses: [ { ref: hubspot.actions.createRecords, config: { objectType: "deals" } }, // always deals — the agent fills in the rest ], ``` Mix fixed and agent-decided fields when some inputs should always be the same (e.g., a specific CRM pipeline ID) while others depend on the conversation context (e.g., a lead's email address). In the UI, each field additionally has a mode selector — **Default** (fixed value), **Auto** (agent decides), or **Disable** (field skipped entirely). Disabling a field is UI-only today; in code, fields are either fixed via `config` or agent-decided. ### Bulk execution Set `isBulkAllowed: 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 tool that files a ticket the agent doesn't need to read back. This applies to tools and sub-agents only: they run as a workflow the agent can either wait on or leave running. A connector action always runs inline, so there is nothing to not wait for — setting `waitUntilFinished` on one is a type error. *** ## 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 with `mcpClients`; Cargo discovers and registers their tools automatically: ```ts theme={null} mcpClients: [ // Any MCP-compatible server, by URL { kind: "custom", name: "notion", url: "https://mcp.notion.com/mcp", authentication: null, disabledToolSlugs: [] }, // An MCP server backed by one of your connectors (by uuid) { kind: "connector", name: "hubspot", connectorUuid: "9c26…", integrationSlug: "hubspotMcp", disabledToolSlugs: [] }, ], ``` Use `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](/mcp-servers/overview). *** ## Best practices The agent relies on descriptions to choose actions. Be specific about what the action does and what it returns. Use names like `Enrich-Company` or `Slack-Notify-Rep` instead of generic names like `Action1`. In your agent's instructions, specify what to do if an action call fails (retry, skip, report error). Only give agents access to the actions they need. Fewer actions = faster, more accurate action selection. *** ## Next steps Connect integrations with defineConnector before referencing their actions. Build reusable tools with defineTool to pass into an agent. # Using UI Source: https://docs.getcargo.ai/agents/using-ui Learn what agents are, and how to build your first one.