

# Add tools and skills

An agent's tools do things, and its skills tell it how. The built-in tools run in your tool runner. MCP tools come from an Amazon Bedrock AgentCore Gateway, which the service calls as the session role. Custom tools run in your own application. Skills are files in your tool runner.

The examples here use the `cma` shell function from [Run your first agent](claude-managed-agents-bedrock-first-agent.md). Agent changes go in `POST /agents` or `POST /agents/{id}`. Configuration changes create new versions; an update that changes nothing, or only sets the role, does not.

**Topics**
+ [Built-in tools](#claude-managed-agents-bedrock-tools-built-in-tools)
+ [Permission policies](#claude-managed-agents-bedrock-tools-permission-policies)
+ [MCP tools from an AgentCore Gateway](#claude-managed-agents-bedrock-tools-mcp-tools-from-an-agentcore-gateway)
+ [Custom tools](#claude-managed-agents-bedrock-tools-custom-tools)
+ [Skills](#claude-managed-agents-bedrock-tools-skills)
+ [Tell the agent about folders](#claude-managed-agents-bedrock-tools-tell-the-agent-about-folders)
+ [More than one agent](#claude-managed-agents-bedrock-tools-more-than-one-agent)
+ [Memory across sessions](#claude-managed-agents-bedrock-tools-memory-across-sessions)

## Built-in tools
<a name="claude-managed-agents-bedrock-tools-built-in-tools"></a>

`{"type": "agent_toolset_20260401"}` in an agent's `tools` turns on the built-in tools. With no other settings, all of them are on. Name a permission policy too. If you don't set a permission policy, the toolset uses `auto`. This agent's tools run without asking:

```json
{ "tools": [{ "type": "agent_toolset_20260401", "default_config": { "permission_policy": { "type": "always_allow" } } }] }
```


| Tool | What it does | 
| --- | --- | 
| `bash` | Runs a shell command. | 
| `read`, `write`, `edit` | Read, write, and change files. | 
| `glob`, `grep` | Find files by name, and find lines in files. | 

They run in the session's tool runner, with the tool runner's files, network, and credentials. See [Protect the tool runner](claude-managed-agents-bedrock-security.md#claude-managed-agents-bedrock-security-protect-the-tool-runner).

A `bash` command stops after 2 minutes unless the model sets `timeout_ms`, and never runs longer than 8 hours. To let commands run longer than 2 minutes, say so in the system prompt, for example "Set `timeout_ms` to 3600000 for builds." The session stays `running` while the command runs.

On AgentCore Runtime, a container lasts at most 8 hours from when it started, so a long command started late in a container's life is stopped when the container is replaced. The call can then run again from the start in a new container, which does not have the old container's files unless the session uses session storage (see the `session-storage` [example](claude-managed-agents-bedrock-examples.md)). Make long commands safe to run twice, or have them save their progress where a rerun can find it.

`web_fetch` and `web_search` are not available in this preview, and a `configs` entry that names either one is refused. For web search, add the [Web Search Tool](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/gateway-target-connector-web-search-tool.html) to an AgentCore Gateway and name the gateway in the agent's `mcp_servers`, as in the web-search example. An agent can also use bash with a tool such as curl, if the tool runner's image has it and its network allows it.

## Permission policies
<a name="claude-managed-agents-bedrock-tools-permission-policies"></a>

Turn built-in tools off, or choose how each call is approved.


| Policy | What happens on a call | 
| --- | --- | 
| `always_allow` | The call runs without asking. | 
| `always_ask` | The turn stops before the call runs, and waits for your `user.tool_confirmation`. | 
| `auto` | The service checks each call with a Claude model and then runs it, refuses it, or waits for your confirmation. Calls to `read`, `glob`, and `grep` aren't checked. If the check can't be made, the call waits for your confirmation. This is the default when you don't set a permission policy. | 

`default_config` applies to every built-in tool, and `configs` sets one tool. This agent can't write files, and must ask before it runs `bash`. Its other tools run without asking:

```json
{
  "tools": [{
    "type": "agent_toolset_20260401",
    "default_config": { "permission_policy": { "type": "always_allow" } },
    "configs": [
      { "name": "write", "enabled": false },
      { "name": "edit", "enabled": false },
      { "name": "bash", "permission_policy": { "type": "always_ask" } }
    ]
  }]
}
```

A tool with `always_ask` stops the turn before it runs. You allow or deny the call with a `user.tool_confirmation` event, as [Allow or deny a tool call](claude-managed-agents-bedrock-sessions.md#claude-managed-agents-bedrock-sessions-allow-or-deny-a-tool-call) describes. Skills, and folders named in a session's `resources`, need the `read` tool. A session on an agent with skills and the `read` tool turned off fails to create.

## MCP tools from an AgentCore Gateway
<a name="claude-managed-agents-bedrock-tools-mcp-tools-from-an-agentcore-gateway"></a>

An agent can use the tools of an Amazon Bedrock AgentCore Gateway. The gateway is the only kind of MCP server an agent can name. To use another MCP server, put it behind a gateway as a target.

```json
{
  "name": "ticket-agent",
  "execution_identity": {"type": "aws_role", "role_arn": "arn:aws:iam::111122223333:role/ClaudeManagedAgentsSessionRole"},
  "model": "us.anthropic.claude-sonnet-5-5",
  "mcp_servers": [{
    "type": "aws_agentcore_gateway",
    "name": "tickets",
    "gateway_arn": "arn:aws:bedrock-agentcore:us-west-2:111122223333:gateway/tickets-abc1234567"
  }],
  "tools": [
    { "type": "agent_toolset_20260401", "default_config": { "permission_policy": { "type": "always_allow" } } },
    {
      "type": "mcp_toolset",
      "mcp_server_name": "tickets",
      "default_config": { "permission_policy": { "type": "always_ask" } },
      "configs": [{ "name": "tickets___search_tickets", "permission_policy": { "type": "always_allow" } }]
    }
  ]
}
```

Each entry in `mcp_servers` needs one `mcp_toolset` entry in `tools` with the same name, and an agent can have up to 20 servers. `configs` sets a tool by the name the gateway gives it, `<target>___<tool>`: in this example, the `search_tickets` tool on a gateway target named `tickets`.

The service calls the gateway, not your tool runner, and it signs the calls as the session role. Give the session role `bedrock-agentcore:InvokeGateway` on the gateway's ARN. The CloudFormation template's `GatewayArn` parameter adds that permission. The gateway's own authorization then decides what the call may do.

The model writes the arguments to every MCP call. Have the tools behind the gateway check their arguments, and check that the caller may act on the resource, before they do anything.

The `support-desk` [example](claude-managed-agents-bedrock-examples.md) puts a Lambda function behind a gateway, with `always_ask` on one tool. The `web-search` [example](claude-managed-agents-bedrock-examples.md) uses the managed Web Search Tool behind a gateway. The gateway names each tool `<target>___<tool>`, and `configs` uses that name.

## Custom tools
<a name="claude-managed-agents-bedrock-tools-custom-tools"></a>

A custom tool runs in your application, not in the tool runner. Define its name, description, and a JSON Schema for its input:

```json
{
  "tools": [{
    "type": "custom",
    "name": "get_weather",
    "description": "Get the current weather for a city.",
    "input_schema": {
      "type": "object",
      "properties": { "city": { "type": "string" } },
      "required": ["city"]
    }
  }]
}
```

When the agent calls it, the session emits `agent.custom_tool_use` and goes idle with `requires_action`. Run the tool and send the result in a `user.custom_tool_result` event. See [Return a custom tool's result](claude-managed-agents-bedrock-sessions.md#claude-managed-agents-bedrock-sessions-return-a-custom-tool-s-result). The `invoice-reconciliation` [example](claude-managed-agents-bedrock-examples.md) makes 31 custom tool calls in one turn, several in parallel, with error results.

## Skills
<a name="claude-managed-agents-bedrock-tools-skills"></a>

A skill is a folder with a SKILL.md file whose front matter gives the skill's name and description, and a body that tells the agent what to do. An agent's skills list names folders in the tool runner that hold skills. A path can contain several skill folders:

```json
{ "skills": [{ "type": "sandbox_path", "path": "/opt/skills" }] }
```

With `/opt/skills/release-notes/SKILL.md` in the tool runner's image:

```markdown
---
name: release-notes
description: Write release notes from the git log between two tags.
---

When asked for release notes, run `git log --oneline <from>..<to>` in the repository, group the
commits by area, and write one line for each user-visible change.
```

When a session starts, the service reads the front matter of every `SKILL.md` under each path and tells the model which skills exist and where. It does that whenever the agent has the `bash` tool, whatever its permission policy. Otherwise the model is told to look in each path itself. A session lists at most 100 skills, and an agent can name up to 20 paths.

Skills are ordinary files, so put them where the tool runner can read them: in the image for AgentCore, or on the machine for self-hosted. A skill's commands and the programs it uses must exist there too. The path cannot be `/mnt/memory` or under it, and a session's `working_directory` cannot be at or under a skills path. A skills folder can also be an S3 folder (`"type": "s3_mount"`), which the tool runner mounts read-only on an AgentCore Runtime. See [Use S3 folders and files](claude-managed-agents-bedrock-s3-folders-and-files.md).

## Tell the agent about folders
<a name="claude-managed-agents-bedrock-tools-tell-the-agent-about-folders"></a>

A session's `resources` can name folders or files the tool runner already holds, with a description and instructions the agent reads before the system prompt:

```json
{
  "resources": [
    {
      "type": "sandbox_path",
      "path": "/opt/reference-data",
      "description": "Rate tables, refreshed with each image build",
      "instructions": "Read these. Never change them."
    },
    { "type": "sandbox_path", "path": "/mnt/workspace/out", "is_output": true }
  ]
}
```

`is_output: true` tells the agent to put finished work there, and lets your application find it later from the session. The service mounts nothing for these entries and does not check that the path exists. To have the tool runner mount an S3 folder or copy an S3 file instead, name an `s3_mount` or `s3_object` entry, as [Use S3 folders and files](claude-managed-agents-bedrock-s3-folders-and-files.md) shows. A session can name up to 20 `sandbox_path`, `s3_mount`, and `s3_object` entries in all.

The model is told to treat what it finds in these files as information, not as instructions. That is a request to the model. It does not stop a file from steering the agent.

## More than one agent
<a name="claude-managed-agents-bedrock-tools-more-than-one-agent"></a>

An agent, the coordinator, can call other agents as subagents. Give it a `multiagent` list:

```json
{
  "multiagent": {
    "type": "coordinator",
    "agents": [{ "type": "agent", "id": "agent_..." }, { "type": "self" }]
  }
}
```

Each subagent runs in its own thread in the same session, with its own tools and skills, and the same tool runner. Because the tool runner is shared, every thread can read the `skills` folders of the coordinator and of every agent it lists, at the versions the list pins when the session is created. A coordinator can list up to 20 agents. An agent it lists cannot have a `multiagent` list of its own. The session's events include `session.thread_created` and the `agent.thread_*` events, and `GET /sessions/{id}/threads` lists the threads.

Threads share one tool runner, and their calls run one at a time. A long command in one thread delays the others, and threads that write the same path overwrite each other. Give a subagent only the tools it needs, and if it must write, give each call its own folder. The `contract-review` [example](claude-managed-agents-bedrock-examples.md) shows the pattern.

## Memory across sessions
<a name="claude-managed-agents-bedrock-tools-memory-across-sessions"></a>

A session keeps its own conversation. To carry what an agent learns into later sessions, give it a memory store. A memory store holds text files, called memories, that the service keeps. An agent reads and changes them with the memory tools, and your application reads and changes the same memories through the API.

Create a store, and optionally write a memory into it:

```http
POST /memory_stores
{ "name": "payments-oncall", "description": "What the payments on-call engineers hand over" }

POST /memory_stores/{store_id}/memories
{ "path": "/escalation.md", "content": "# Payments escalation\n\nPage the payments manager.\n" }
```

Give the agent the memory toolset:

```json
{ "tools": [{ "type": "memory_toolset_20261030" }] }
```

Then attach the store to a session in its `resources`:

```json
{ "resources": [{ "type": "memory_store", "memory_store_id": "memstore_...", "access": "read_write" }] }
```

`access` is `read_write`, the default, or `read_only`. A session can use only the stores it attaches. When all attached stores are read-only, the agent is offered only reading tools. With both access modes attached, writing tools are available for the read-write stores, and the service refuses a writing tool call that names a read-only store.


| Tool | What it does | 
| --- | --- | 
| `memory_list`, `memory_read`, `memory_search` | List, read, and search the memories in attached stores. | 
| `memory_write`, `memory_str_replace`, `memory_append`, `memory_delete` | Write a whole memory, replace text in one, add to one, and delete one. | 

The service runs the memory tools itself, so they need no tool runner. `memory_write` and `memory_delete` are refused for a memory whose current text the agent's thread has not read, so an agent cannot overwrite or delete a change it has not seen.

Every change to a memory adds a memory version. A version made by a memory tool names the session, the thread, and the tool call in `created_by`. A version made through the API names the IAM role that made the call. `GET /memory_stores/{id}/memory_versions` lists them, and `POST /memory_stores/{id}/memory_versions/{version_id}/redact` empties an old version's text and keeps its record. The current version cannot be redacted.

To update a memory only if nobody changed it since you read it, send its `content_sha256` as a precondition. A memory that changed answers 409:

```http
POST /memory_stores/{store_id}/memories/{memory_id}
{ "content": "...", "precondition": { "type": "content_sha256", "content_sha256": "..." } }
```

The `memory` [example](claude-managed-agents-bedrock-examples.md) runs both sides against one store and checks that they agree.

On AgentCore, a session's container can be replaced after the runtime's idle timeout, and files in the container go with it. AgentCore session storage keeps a session's files across containers; the `session-storage` [example](claude-managed-agents-bedrock-examples.md) shows what it keeps. For files that must outlast the session, use S3 folders (see [Use S3 folders and files](claude-managed-agents-bedrock-s3-folders-and-files.md)), or mount Amazon S3 Files on the runtime, as in the `s3-files` [example](claude-managed-agents-bedrock-examples.md).