> ## Documentation Index
> Fetch the complete documentation index at: https://cadenya.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Assign tools, memory, and sub-agents

> Configure the capabilities available to one agent variation and choose the narrowest assignment that fits the job.

Assignments belong to a variation. Two variations on the same agent can use different tools, tool sets, sub-agents, or memory without changing the agent ID your application calls.

## Open the assignment picker

Open an agent, stay on **Variations**, and select the variation. Under **Assignments**, click **Add**.

An inline assignment row opens with three callable assignment kinds:

| Kind          | What the variation receives         | Use it when                                                        |
| ------------- | ----------------------------------- | ------------------------------------------------------------------ |
| **Tool**      | One exact tool                      | The variation needs a narrow, explicit capability                  |
| **Tool Set**  | Every available tool in the set     | The set is intentionally small or progressive discovery is enabled |
| **Sub-Agent** | A published agent exposed as a tool | A specialist should run in its own objective and context           |

<Frame caption="A variation can receive a tool, complete tool set, or sub-agent">
  <img src="https://mintcdn.com/cadenya/uaQ7Uw3TsXMwadaa/images/docs/agents/assignment-picker.webp?fit=max&auto=format&n=uaQ7Uw3TsXMwadaa&q=85&s=2fe4281afce8dcb48b70d17de9fd52f8" alt="Inline variation assignment picker set to Tool Set with the Faker MCP tool set already attached" width="1910" height="358" data-path="images/docs/agents/assignment-picker.webp" />
</Frame>

Choose a kind, search for the resource, and select it. The assignment appears in the same panel after it succeeds.

## Assign a tool set from code

The assignment request is a discriminated union. Set `type` and exactly one matching ID:

```typescript theme={null}
await client.agents.variations.addAssignment(
  agentId,
  variationId,
  {
    workspaceId,
    type: 'toolSetId',
    toolSetId: 'external_id:faker-mcp',
  },
);
```

The other variants are:

```typescript theme={null}
await client.agents.variations.addAssignment(agentId, variationId, {
  workspaceId,
  type: 'toolId',
  toolId: 'tool_...',
});

await client.agents.variations.addAssignment(agentId, variationId, {
  workspaceId,
  type: 'subAgentId',
  subAgentId: 'external_id:refund-specialist',
});
```

## Add memory separately

Memory layers are ordered baseline context, not callable tools. Under **Memory Layers**, click **Add**, select a layer, and place it in the cascade.

From code:

```typescript theme={null}
await client.agents.variations.addMemoryLayer(
  agentId,
  variationId,
  {
    workspaceId,
    memoryLayerId: 'external_id:support-policy',
    position: 0,
  },
);
```

Lower positions are more specific and resolve first. A variation can have at most ten baseline memory-layer assignments.

## Keep the initial context deliberate

Assigning a complete tool set loads every available tool definition into the model's starting context unless **Enable progressive tool discovery** is on for the variation.

Use this rule:

* Assign an individual tool when only one or two operations are required.
* Assign a complete small tool set when its operations belong together.
* Enable progressive discovery for a large tool set so the variation starts with `tool_search` and loads named tools on demand.
* Use a sub-agent when the capability needs a separate prompt, tool budget, context, or memory.

<CardGroup cols={2}>
  <Card title="Prevent tool bloat" icon="magnifying-glass" href="/docs/guides/preventing-tool-bloat">
    Configure progressive discovery for large tool catalogs.
  </Card>

  <Card title="Delegate to sub-agents" icon="sitemap" href="/docs/guides/delegate-to-sub-agents">
    Build and attach a specialist that runs in a child objective.
  </Card>
</CardGroup>
