Agent builder
Build Anthropic Managed Agents through a non-technical conversation. The skill asks the user what kind of agent they want, which connectors and abilities it should have, and then silently translates that into Anthropic's Managed Agents REST API: creates the Agent, Environment, Vault and credentials, attaches MCP servers and Skills, opens a Session, and sends a first message. Hides the developer details. USE THIS SKILL WHEN user says \"agent builder\", \"build an agent\", \"create an agent\", \"managed agent\", \"managed agents\", \"deploy an agent\", \"anthropic agent\", \"agent platform\", \"agents API\", \"agent session\", \"agent environment\", \"agent vault\", \"upload skill\", \"attach skill\", \"/v1/agents\", \"/v1/skills\", or wants to spin up an autonomous agent that runs on Anthropic's managed infrastructure with connectors and skills.
By- name:
- agent-builder
- description:
- Build Anthropic Managed Agents through a non-technical conversation. The skill asks the user what kind of agent they want, which connectors and abilities it should have, and then silently translates that into Anthropic's Managed Agents REST API: creates the Agent, Environment, Vault and credentials, attaches MCP servers and Skills, opens a Session, and sends a first message. Hides the developer details. USE THIS SKILL WHEN user says \"agent builder\", \"build an agent\", \"create an agent\", \"managed agent\", \"managed agents\", \"deploy an agent\", \"anthropic agent\", \"agent platform\", \"agents API\", \"agent session\", \"agent environment\", \"agent vault\", \"upload skill\", \"attach skill\", \"/v1/agents\", \"/v1/skills\", or wants to spin up an autonomous agent that runs on Anthropic's managed infrastructure with connectors and skills.
Agent Builder
Build Anthropic Managed Agents through a friendly, non-technical conversation. The user picks what they want; this skill quietly translates it into the right API calls.
When This Skill Loads
- Silently read every file in
references/. Do not narrate this. - Do not list "Step 1, Step 2, …" in chat. Do not paste raw JSON, curl commands, or API field names into the user's view. Those exist only in the references for your own use.
- Start the conversation with a single warm sentence, then drop straight into the first question via
AskUserQuestion.
Opener (example, vary as needed):
"Let's build your agent. A few quick questions and I'll set everything up for you."
How To Drive The Conversation
Every branching question MUST go through AskUserQuestion, never plain chat. Plain chat is reserved for short confirmations and the final summary. Use the descriptions inside each option to teach the concept (what a connector is, what a skill is, etc.) so the user never has to know the underlying terms.
Run the questions in this order. Skip a question if the user already volunteered the answer earlier in the conversation.
Q1. What kind of agent are you building?
Use AskUserQuestion. Header: Agent type. Options (single-select):
- Research & analysis. Reads sources on the web or in your tools, summarizes, finds patterns.
- Content creation. Drafts posts, emails, scripts, documents.
- Operations & automation. Handles tasks across your apps (Slack, Notion, CRM, etc.).
- Custom. Describe it yourself.
If "Custom", follow up with a single open question: "In one sentence, what should this agent do?"
Internally, use the answer to seed a short system prompt. The user never sees the word "system prompt".
Q2. Which apps should it connect to?
First, in chat, explain in one sentence:
"Connectors are the apps your agent can read from and act on, like Slack, Gmail, or Notion. Pick whichever this agent needs."
Then use AskUserQuestion with multiSelect: true. Header: Connectors. Options:
- Slack. Read channels, send messages, search history.
- Notion. Read pages, create or update notes.
- Gmail / Google Workspace. Read and send mail, work with Drive, Calendar.
- GitHub. Read issues, comment on PRs, browse code.
If the user names something not in the list (e.g. Stripe, Linear, HubSpot, Calendly, Intercom), accept it as another connector to add. Do NOT ask the user for the MCP server URL. You find it yourself.
Finding the MCP URL for a connector
For every connector picked (preset or user-named), resolve the official remote MCP endpoint by web search. Do this silently in the background; do not show search results in chat. Use WebSearch (or the available web search tool) with a query like "<connector> official remote MCP server URL" and prefer hits from:
- The vendor's own docs (e.g.
stripe.com/docs/mcp,developers.notion.com/docs/mcp). - Anthropic's connector directory.
- The MCP registry (
https://mcp.soorhttps://pulsemcp.com).
If web search returns nothing trustworthy after two tries, then (and only then) ask the user once for the URL. Never invent or guess a URL.
Default URLs you can use without searching (only if exact match):
- Gmail / Google Workspace → use the Anthropic-hosted Google Workspace connector URL discovered via the directory.
- Slack →
https://mcp.slack.com/mcp - GitHub →
https://api.githubcopilot.com/mcp/ - Stripe →
https://mcp.stripe.com/
Registering the connector
For every selected connector, internally:
- Add
{ "type": "url", "name": <slug>, "url": <resolved_url> }tomcp_servers. - Add a matching
{ "type": "mcp_toolset", "mcp_server_name": <slug>, ... }totools.
Do not collect any access tokens or OAuth credentials in this flow. The agent is built with MCP servers attached but no vault credentials. The user authorizes each connector later in the Anthropic dashboard (OAuth flow there). When you create the vault in the build phase, create it empty.
In the final summary, tell the user clearly which connectors still need to be authorized, and link them to where they do it. Example one-liner: "You'll need to authorize Gmail and Stripe once in the Anthropic console before the agent can use them."
Q3. What core abilities should it have?
Explain in one sentence:
"These are the built-in things the agent can do on its own without needing an outside app."
Use AskUserQuestion, multiSelect: true. Header: Abilities. Options:
- Work with files. Read, write, and edit files in its workspace.
- Run code. Execute bash commands and scripts.
- Search the web. Look things up online.
- Open web pages. Fetch and read specific URLs.
Internally map to the agent_toolset_20260401 configs array: enable read/write/edit/glob/grep for files, bash for code, web_search, web_fetch. Anything not picked is disabled.
Q4. Should it work with documents?
Use AskUserQuestion, multiSelect: true. Header: Documents. Options:
- Spreadsheets. Excel files (xlsx).
- Presentations. PowerPoint (pptx).
- Word docs. Docx.
- PDFs. Generate and fill PDFs.
Map each pick to an { "type": "anthropic", "skill_id": "<xlsx|pptx|docx|pdf>" } entry in skills.
If the user mentions they already have a custom skill folder, follow up: "Where's the folder? I'll upload it for you." Then upload via POST /v1/skills (see references/skills-upload.md) and attach the returned skill_id as { "type": "custom", "skill_id": "...", "version": "latest" }.
Q5. How should it behave?
Use AskUserQuestion. Header: Style. Options (single-select):
- Run on its own. Acts autonomously without asking permission. Best for trusted, repeatable jobs.
- Check in before acting. Asks before running tools that touch outside apps.
Map:
- "Run on its own" →
permission_policy: { "type": "always_allow" }everywhere. - "Check in before acting" →
always_allowfor built-in tools,always_askformcp_toolsetentries.
Q6. How smart vs how fast?
Use AskUserQuestion. Header: Brainpower. Options (single-select):
- Smartest, slower. Best reasoning, for hard work.
- Balanced. Solid for most tasks (recommended).
- Fast and cheap. For simple, high-volume jobs.
Map:
- Smartest →
{"id": "claude-opus-4-7", "speed": "standard"} - Balanced →
"claude-sonnet-4-6" - Fast and cheap →
"claude-haiku-4-5-20251001"
If the user picks "Smartest" and the task sounds simple/repetitive, gently suggest "Balanced" once.
Q7. Name and one-line description
In chat (no AskUserQuestion here, it's free text):
"Last bit: what should I call this agent, and can you give me one sentence describing its job?"
Capture two short strings.
After The Questions
The only secret you ever ask for is the Anthropic API key. Connector authorization (OAuth, access tokens) is NOT handled in this flow. The user will authorize each connector later in the Anthropic console.
API key. Ask once: "I'll need your Anthropic API key (starts with
sk-ant-). I'll only use it for this session and won't write it down." Export asANTHROPIC_API_KEYin the shell.Run the build. Without narrating each call, execute in order:
- Upload any custom skills (if Q4 produced any).
POST /v1/agentswith the assembled body (includesmcp_serversand matchingmcp_toolsetentries, but no credentials).POST /v1/environments.POST /v1/vaultswith the chosendisplay_name. Do NOT add any credentials. Leave the vault empty.POST /v1/sessionsreferencing the empty vault. The session creates fine; MCP calls will simply error until the user authorizes the connectors.
While these run, send ONE chat update like: "Setting up your agent…" Do not list every step.
Final summary. Present a clean, non-technical recap:
✅ Your agent "${name}" is ready.
What it can do:
- ${ability_summary}
- Connected to: ${connector_names}
- Document skills: ${doc_skills or "none"}
- Style: ${style}
Before it can actually use your connectors, authorize them once:
→ Open https://console.anthropic.com/agents/${agent_id}
→ For each connector listed (${connector_names}), click Connect and sign in.
To use it again, here are the IDs (keep them safe):
Agent ID: ${agent_id}
Session ID: ${session_id}
If only ${connector_names} is empty, drop the authorize-them block. If connectors exist, always show it.
Offer 3 follow-ups via AskUserQuestion (header: Next):
- Try it now. Send a test message.
- Tweak something. Change behavior, add a connector, swap a skill.
- Done for now. Wrap up.
Hard Rules
- Always use
AskUserQuestionfor branching choices. Plain prompts in chat are reserved for free-text answers (name, description, custom system-prompt sentence, pasting tokens). - Never show raw JSON, curl commands, API field names, or step numbers in the user-facing chat.
- Never persist secrets to disk. API key and connector tokens live in shell env vars for this session only.
- Never log or echo tokens. Mask in any debug output.
- One API call at a time; each depends on the previous. On non-2xx, stop and tell the user in plain English what failed (e.g. "Slack rejected the token") and ask how they'd like to proceed.
- Up to 20 MCP servers and 20 skills per agent.
- Every connector chosen in Q2 must produce both an
mcp_serversentry and a matchingmcp_toolset. The API rejects mismatches.
Resources (for your own reference, never shown to the user)
references/api-reference.md. Endpoints, methods, headers, response shapes.references/payloads.md. JSON bodies for every API call.references/tools-reference.md. Built-in tool names, configs, permission policies, custom tools.references/mcp-and-vaults.md. MCP server declaration, vault creation, credential types, error handling.references/skills-upload.md. Uploading and attaching custom and pre-built skills.
Open this reference as its own page
Anthropic Managed Agents API Reference
Base URL: https://api.anthropic.com
Required Headers
For Managed Agents endpoints (agents, environments, vaults, sessions, events):
x-api-key: $ANTHROPIC_API_KEY
anthropic-version: 2023-06-01
anthropic-beta: managed-agents-2026-04-01
content-type: application/json
For Custom Skills endpoints (uploading/managing custom skills):
x-api-key: $ANTHROPIC_API_KEY
anthropic-version: 2023-06-01
anthropic-beta: skills-2025-10-02
content-type: multipart/form-data (only on upload endpoints)
Endpoints
Agents
| Operation | Method | Path |
|---|---|---|
| Create | POST | /v1/agents |
| Get | GET | /v1/agents/{agent_id} |
| List | GET | /v1/agents |
| Update | POST | /v1/agents/{agent_id} (include version for optimistic locking) |
| List versions | GET | /v1/agents/{agent_id}/versions |
| Archive | POST | /v1/agents/{agent_id}/archive |
Returned fields on agent objects: id, type, name, description, model, system, tools, mcp_servers, skills, metadata, version, created_at, updated_at, archived_at.
Update semantics:
- Scalar fields (
model,system,name,description) are replaced. Passnullto clearsystem/description.modelandnamecannot be cleared. - Array fields (
tools,mcp_servers,skills) are fully replaced. Empty array ornullclears. multiagentis replaced as a whole.metadatais merged at the key level. Empty string deletes a key.- No-op updates do not bump the version.
Environments
| Operation | Method | Path |
|---|---|---|
| Create | POST | /v1/environments |
| Get | GET | /v1/environments/{environment_id} |
| List | GET | /v1/environments |
Vaults
| Operation | Method | Path |
|---|---|---|
| Create | POST | /v1/vaults |
| Get | GET | /v1/vaults/{vault_id} |
| List | GET | /v1/vaults |
| Add credential | POST | /v1/vaults/{vault_id}/credentials |
| Delete credential | DELETE | /v1/vaults/{vault_id}/credentials/{credential_id} |
Sessions
| Operation | Method | Path |
|---|---|---|
| Create | POST | /v1/sessions |
| Get | GET | /v1/sessions/{session_id} |
| List | GET | /v1/sessions |
| Send event | POST | /v1/sessions/{session_id}/events |
| Stream events | GET | /v1/sessions/{session_id}/events (SSE) |
Custom Skills
| Operation | Method | Path |
|---|---|---|
| Upload (new skill) | POST | /v1/skills |
| List | GET | /v1/skills (filter with ?source=custom) |
| Get | GET | /v1/skills/{skill_id} |
| Create new version | POST | /v1/skills/{skill_id}/versions |
| Delete version | DELETE | /v1/skills/{skill_id}/versions/{version} |
| Delete skill | DELETE | /v1/skills/{skill_id} (must delete all versions first) |
Standard Error Shape
{ "type": "error", "error": { "type": "...", "message": "..." } }
Common types:
invalid_request_error. Body schema mismatch.authentication_error. Bad or missingx-api-key.permission_error. Missing beta header or org not allowlisted.not_found_error. Bad ID from a previous step.conflict_error. Staleversionon an agent update.
Session Event Types
user.message. The user sending a message.assistant.message. Claude's reply.assistant.tool_use. A tool call from Claude.tool_result. The result of a tool call.session.status_running/session.status_idle. Session state transitions.session.error. Includesmcp_server_name, error type,retry_status. Seemcp-and-vaults.md.- Custom tool calls. See
payloads.md"Custom tool flow" section.
Open this reference as its own page
MCP Servers and Vault Credentials
MCP config is split across two steps:
- Agent declares which MCP servers exist (names + URLs only, no secrets).
- Session supplies auth via vault credentials referenced by
vault_ids.
Declare MCP Servers on the Agent
Each entry:
| Field | Required | Description |
|---|---|---|
type |
yes | Must be "url" |
name |
yes | Unique within the agent. 1-255 chars. Used as mcp_server_name in tools and on session events. |
url |
yes | Up to 2048 chars. Remote MCP endpoint, streamable HTTP transport. |
"mcp_servers": [
{ "type": "url", "name": "github", "url": "https://api.githubcopilot.com/mcp/" },
{ "type": "url", "name": "slack", "url": "https://mcp.slack.com/mcp" }
]
Limits:
- Up to 20 MCP servers per agent.
- Names unique within the agent.
- Each
mcp_serversentry MUST be referenced by exactly onemcp_toolsetintools, and everymcp_toolsetMUST reference a declared server.
Create a Vault
{ "display_name": "${vault_display_name}" }
Response: { "id": "vault_…", … }.
Add Credential. POST /v1/vaults/${vault_id}/credentials
Credentials match MCP servers by exact mcp_server_url. If no credential URL matches, the connection is attempted unauthenticated.
static_bearer
For MCPs that accept a static API key as a bearer token.
{
"display_name": "${cred_display_name}",
"auth": {
"type": "static_bearer",
"mcp_server_url": "${mcp_url}",
"token": "${bearer_token}"
}
}
mcp_oauth
For MCPs that use OAuth (Slack, Fireflies, Notion, Circle, etc.).
{
"display_name": "${cred_display_name}",
"auth": {
"type": "mcp_oauth",
"mcp_server_url": "${mcp_url}",
"access_token": "${access_token}",
"expires_at": "${iso8601_expiry}",
"refresh": {
"refresh_token": "${refresh_token}",
"client_id": "${client_id}",
"token_endpoint": "${token_endpoint}",
"token_endpoint_auth": { "type": "none" }
}
}
}
Drop the refresh block if the user doesn't have refresh-token info.
Bind Vaults at Session Creation
{
"agent": "${agent_id}",
"environment_id": "${env_id}",
"vault_ids": ["${vault_id}"]
}
Multiple vaults can be passed if credentials are split across them.
Connection and Authentication Failures
Session creation does not validate MCP connectivity. Failures surface as session.error events:
| Error type | Meaning |
|---|---|
mcp_connection_failed_error |
Server unreachable. Network error, timeout, or non-auth HTTP failure. |
mcp_authentication_failed_error |
Server reachable but rejected the credential. |
Each event includes the affected mcp_server_name and a retry_status. Connection retries on the next session.status_idle to session.status_running transition.
The user's app can:
- Continue without the affected server's tools.
- Rotate the credential and retry.
- Surface the error and pause.
MCP Tool Output Handling
Output > 100K tokens auto-saves to the sandbox; the model gets a truncated preview and the file path and reads the rest via read.
Supported MCP Servers
- Remote MCP servers exposing an HTTP endpoint (streamable HTTP transport).
- Private MCPs reachable via MCP tunnels.
stdio-only MCPs are not supported by Managed Agents directly. They must be wrapped in an HTTP-transport adapter or tunneled.
Open this reference as its own page
Request Payloads
Copy-paste JSON bodies for every step. Substitute ${…} placeholders with user input or values captured from prior responses. For tool/MCP/vault/skill specifics, see the sibling reference files.
1. Create Agent. POST /v1/agents
Minimal:
{
"name": "${agent_name}",
"model": "claude-opus-4-7",
"system": "${system_prompt}",
"tools": [{ "type": "agent_toolset_20260401" }]
}
With fast mode (Opus 4.6 / 4.7 only):
{
"name": "${agent_name}",
"model": { "id": "claude-opus-4-7", "speed": "fast" }
}
Full example with MCP server, custom + Anthropic skills, custom tool, metadata:
{
"name": "${agent_name}",
"description": "${description}",
"model": { "id": "claude-sonnet-4-6", "speed": "standard" },
"system": "${system_prompt}",
"tools": [
{
"type": "agent_toolset_20260401",
"default_config": {
"enabled": true,
"permission_policy": { "type": "always_allow" }
},
"configs": [
{ "name": "web_search", "enabled": false },
{ "name": "web_fetch", "enabled": false }
]
},
{
"type": "mcp_toolset",
"mcp_server_name": "${mcp_name}",
"default_config": {
"enabled": true,
"permission_policy": { "type": "always_allow" }
},
"configs": []
},
{
"type": "custom",
"name": "get_weather",
"description": "Get current weather for a location",
"input_schema": {
"type": "object",
"properties": { "location": { "type": "string" } },
"required": ["location"]
}
}
],
"mcp_servers": [
{ "type": "url", "name": "${mcp_name}", "url": "${mcp_url}" }
],
"skills": [
{ "type": "anthropic", "skill_id": "xlsx" },
{ "type": "custom", "skill_id": "skill_abc123", "version": "latest" }
],
"metadata": { "owner": "${owner}", "purpose": "${purpose}" }
}
Repeat the mcp_servers entry and the matching mcp_toolset block for every MCP server. Every mcp_servers entry must have a corresponding mcp_toolset and vice versa, or the API rejects the create.
Response (truncated):
{
"id": "agent_01HqR2k7vXbZ9mNpL3wYcT8f",
"version": 1,
"model": { "id": "claude-opus-4-7", "speed": "standard" },
"created_at": "...",
"archived_at": null
}
Capture id and version into shell vars.
2. Update Agent. POST /v1/agents/${agent_id}
Pass current version for optimistic locking. Only include fields you want to change.
{
"version": ${current_version},
"system": "${new_system_prompt}"
}
Returns the new agent object with incremented version. If body matches current state, no new version is created.
3. Archive Agent. POST /v1/agents/${agent_id}/archive
Empty body. Returns the agent with archived_at set.
4. Create Environment. POST /v1/environments
{
"name": "${env_name}",
"description": "Environment for ${agent_name}",
"metadata": {},
"scope": "organization",
"config": {
"type": "cloud",
"packages": {
"pip": [],
"npm": [],
"apt": [],
"cargo": [],
"gem": [],
"go": []
},
"networking": { "type": "unrestricted" }
}
}
Populate package arrays if the agent needs system or language deps preinstalled in its sandbox.
5. Create Vault. POST /v1/vaults
{ "display_name": "${vault_display_name}" }
6. Add Credential. POST /v1/vaults/${vault_id}/credentials
See mcp-and-vaults.md for static_bearer and mcp_oauth body shapes.
7. Create Session. POST /v1/sessions
{
"agent": "${agent_id}",
"environment_id": "${env_id}",
"vault_ids": ["${vault_id}"]
}
agent can also be passed as { "type": "agent", "id": "${agent_id}" }. Both accepted; the string form is preferred.
8. Send User Message. POST /v1/sessions/${session_id}/events
{
"events": [
{
"type": "user.message",
"content": [{ "type": "text", "text": "${message}" }]
}
]
}
Custom Tool Flow
When the agent emits an assistant.tool_use event for a custom tool, your app executes the tool and posts back a tool_result:
{
"events": [
{
"type": "tool_result",
"tool_use_id": "${tool_use_id_from_event}",
"content": [{ "type": "text", "text": "${tool_output_string}" }],
"is_error": false
}
]
}
curl Skeleton
curl --fail-with-body --silent --show-error \
-X POST "https://api.anthropic.com/v1/agents" \
-H "x-api-key: $ANTHROPIC_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "anthropic-beta: managed-agents-2026-04-01" \
-H "content-type: application/json" \
-d @agent.json | tee /tmp/agent.json
AGENT_ID=$(jq -r '.id' /tmp/agent.json)
AGENT_VER=$(jq -r '.version' /tmp/agent.json)
If jq is unavailable:
AGENT_ID=$(python3 -c 'import sys,json;d=json.load(sys.stdin);print(d["id"])' < /tmp/agent.json)
Open this reference as its own page
Skills: Upload, Version, Attach
Two kinds of skills can be attached to a managed agent.
Pre-built Anthropic Skills
No upload needed. Reference by short name:
skill_id |
Purpose |
|---|---|
pptx |
PowerPoint authoring/editing |
xlsx |
Excel authoring, analysis, charts |
docx |
Word documents |
pdf |
PDF generation and form handling |
Attach in the agent body:
"skills": [{ "type": "anthropic", "skill_id": "xlsx" }]
Custom Skills
Filesystem-based skills the user authored. Must be uploaded to the workspace first via the Skills API, then attached by skill_id and version.
Skill folder structure
my-skill/
├── SKILL.md ← required at top level
├── REFERENCE.md ← optional progressive disclosure
└── scripts/
└── do_thing.py ← optional bundled code
SKILL.md must have YAML frontmatter:
---
name: my-skill # max 64 chars, lowercase/numbers/hyphens, no "anthropic"/"claude"
description: Short hook describing what the skill does and when to use it (max 1024 chars).
---
# My Skill
...
Upload. POST /v1/skills
Beta header: skills-2025-10-02. Content-type: multipart/form-data. Max 30 MB.
Zip upload (preferred for >5 files):
zip -r my-skill.zip my-skill/
curl --fail-with-body -X POST "https://api.anthropic.com/v1/skills" \
-H "x-api-key: $ANTHROPIC_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "anthropic-beta: skills-2025-10-02" \
-F "display_title=My Skill" \
-F "files[]=@my-skill.zip"
Individual files (preserve root path via ;filename=):
curl --fail-with-body -X POST "https://api.anthropic.com/v1/skills" \
-H "x-api-key: $ANTHROPIC_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "anthropic-beta: skills-2025-10-02" \
-F "display_title=My Skill" \
-F "files[]=@my-skill/SKILL.md;filename=my-skill/SKILL.md" \
-F "files[]=@my-skill/scripts/do_thing.py;filename=my-skill/scripts/do_thing.py"
Multipart fields:
| Param | Required | Description |
|---|---|---|
display_title |
yes | Human-readable name, max 64 chars |
files[] |
yes | One or more files. SKILL.md must exist at the top level of the resulting tree. |
Response:
{
"id": "skill_01AbCdEfGhIjKlMnOpQrStUv",
"display_title": "My Skill",
"latest_version": "1759178010641129",
"created_at": "2026-01-15T10:30:00Z",
"source": "custom"
}
Custom skills are shared workspace-wide. All workspace members can attach them.
Add a new version. POST /v1/skills/{skill_id}/versions
curl --fail-with-body -X POST "https://api.anthropic.com/v1/skills/${SKILL_ID}/versions" \
-H "x-api-key: $ANTHROPIC_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "anthropic-beta: skills-2025-10-02" \
-F "files[]=@my-skill.zip"
Response:
{ "skill_id": "skill_…", "version": "1759178010641130", "created_at": "…" }
List. GET /v1/skills
Optional ?source=custom filter.
curl "https://api.anthropic.com/v1/skills?source=custom" \
-H "x-api-key: $ANTHROPIC_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "anthropic-beta: skills-2025-10-02"
Get. GET /v1/skills/{skill_id}
Delete
Must delete every version first, then the skill record:
curl -X DELETE "https://api.anthropic.com/v1/skills/${SKILL_ID}/versions/${VERSION}" \
-H "x-api-key: $ANTHROPIC_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "anthropic-beta: skills-2025-10-02"
curl -X DELETE "https://api.anthropic.com/v1/skills/${SKILL_ID}" \
-H "x-api-key: $ANTHROPIC_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "anthropic-beta: skills-2025-10-02"
Attach a Custom Skill to the Agent
"skills": [
{ "type": "custom", "skill_id": "skill_01AbCdEfGhIjKlMnOpQrStUv", "version": "latest" }
]
version can be "latest" or a specific epoch-timestamp version string.
Mixing Skills
"skills": [
{ "type": "anthropic", "skill_id": "xlsx" },
{ "type": "anthropic", "skill_id": "pdf" },
{ "type": "custom", "skill_id": "skill_finance_v1", "version": "latest" }
]
Up to 20 skills per session (counted across every agent in a multiagent session).
Constraints to Surface to the User
- Custom skills do not sync across surfaces. A skill uploaded via the API is not the same record as one in claude.ai or Claude Code.
- API skill runtime: no internet access, no runtime package installation, only the pre-installed code-execution image packages are available.
- Treat skill code like installing software. Audit untrusted skills before upload.
Open this reference as its own page
Tools Reference
Three tool kinds attach to an agent via the tools array.
1. agent_toolset_20260401 (built-in toolset)
Sub-tools, all enabled by default:
| Name | Description |
|---|---|
bash |
Execute bash commands in a shell session |
read |
Read a file from the local filesystem |
write |
Write a file to the local filesystem |
edit |
String replacement in a file |
glob |
Fast file pattern matching using glob patterns |
grep |
Text search using regex patterns |
web_fetch |
Fetch content from a URL |
web_search |
Search the web for information |
Tool outputs > 100K tokens are auto-written to a sandbox file; the model gets a truncated preview + path.
Configuration pattern
default_config applies to every sub-tool; configs[] overrides per tool name. Both accept enabled and permission_policy.
Disable specific tools (keep the rest on):
{
"type": "agent_toolset_20260401",
"configs": [
{ "name": "web_fetch", "enabled": false },
{ "name": "web_search", "enabled": false }
]
}
Enable only specific tools (everything else off):
{
"type": "agent_toolset_20260401",
"default_config": { "enabled": false },
"configs": [
{ "name": "bash", "enabled": true },
{ "name": "read", "enabled": true },
{ "name": "write", "enabled": true }
]
}
2. mcp_toolset (per MCP server)
Exposes tools from one MCP server declared in the agent's mcp_servers array. Reference the server by mcp_server_name. Same default_config + configs pattern.
Default permission_policy for mcp_toolset is always_ask. To run fully autonomous, override to always_allow.
Enable only specific MCP tools:
{
"type": "mcp_toolset",
"mcp_server_name": "github",
"default_config": { "enabled": false, "permission_policy": { "type": "always_allow" } },
"configs": [
{ "name": "get_issue", "enabled": true },
{ "name": "list_issues", "enabled": true },
{ "name": "add_issue_comment", "enabled": true }
]
}
Disable a single dangerous MCP tool:
{
"type": "mcp_toolset",
"mcp_server_name": "github",
"configs": [
{ "name": "delete_repository", "enabled": false }
]
}
3. custom tools (user-defined, client-executed)
Same model as the Messages API tool-use pattern. Claude emits an assistant.tool_use event; the user's app executes and replies with a tool_result event (see payloads.md).
{
"type": "custom",
"name": "get_weather",
"description": "Get current weather for a location. Use when the user asks about temperature, forecast, or weather conditions. Returns temperature in Celsius and a short condition string.",
"input_schema": {
"type": "object",
"properties": {
"location": { "type": "string", "description": "City name" }
},
"required": ["location"]
}
}
Best practices:
- Write extremely detailed
description(3-4 sentences minimum). Explain what the tool does, when to use it, when NOT to use it, and the meaning of every parameter. - Consolidate related operations into one tool with an
actionparam rather than many narrow tools. - Namespace tool names by resource (
db_query,storage_read). - Return high-signal, stable identifiers, not opaque internals.
Permission Policy Types
Used in default_config.permission_policy and per-tool configs[].permission_policy.
| Type | Behavior |
|---|---|
always_allow |
Tool runs without user confirmation. Use for autonomous agents. |
always_ask |
Tool emits a confirmation request the user's app must approve. Default for mcp_toolset. |
Confirmation events appear in the session stream. The user's app responds to permit or deny each call.
Tool Validation Rules
- Every
mcp_serversentry must be referenced by anmcp_toolsetand vice versa. Dangling references reject the agent. - Tool names within a single agent must be unique (custom tools + sub-tool names should not collide).
- An agent can declare up to 20 MCP servers.
More in this playbook
Sf ai agentforce
Agentforce Builder metadata path for Builder-managed topics/actions, Prompt Builder templates, GenAiFunction/GenAiPlugin, Models API, and custom Lightning types. TRIGGER when: user maintains or configures Builder metadata agents, creates topics/actions, works with Prompt Builder templates, or touches .genAiFunction, .genAiPlugin, or .genAiPromptTemplate metadata XML files. DO NOT TRIGGER when: Agent Script DSL .agent files (use sf-ai-agentscript), agent testing (use sf-ai-agentforce-testing), or persona design (use sf-ai-agentforce-persona).
Agentic workflowsMITSf ai agentforce grid
Use this skill whenever users want to build, inspect, debug, automate, or publish workflows in Agentforce Grid (AI Workbench) using Salesforce plus the Grid MCP or direct Grid REST calls. Trigger it for Grid workbook creation, worksheet setup, Object/Reference/AI/Agent/AgentTest/Evaluation/PromptTemplate/InvocableAction column design, prompt drafting inside Grid, worksheet execution troubleshooting, Grid YAML `apply_grid` specs, and Windows-specific Grid setup issues. Also use it when users mention AI Workbench, Grid Studio, workbook IDs, worksheet IDs, Grid Connect, or ask for recipes like "top opportunities with AI email drafts", "agent test suite in Grid", or "build this worksheet from YAML". Do not use it for generic Salesforce work unrelated to Agentforce Grid.
Agentic workflowsMITSf ai agentforce observability
Agentforce session tracing extraction and analysis. TRIGGER when: user extracts STDM data from Data Cloud, analyzes agent session traces, debugs agent conversations via telemetry, or works with .parquet files from Agentforce. DO NOT TRIGGER when: testing agents (use sf-ai-agentforce-testing), Apex debug logs (use sf-debug), or building agents (use sf-ai-agentforce).

