Setup Skills for your Agent
Agentic Skill Tools
Enable your agent to access and utilize skills with pre-built tools.
What you’ll build
In this quickstart, you’ll learn how to:- Upload a skill from a ZIP file
- Browse the skill catalog
- Retrieve skill metadata and file index
- Read files from a skill
- Delete skills when no longer needed
Prerequisites
Before you begin, ensure you have:- An Acontext API key from Acontext Dashboard, or local deployment
- A skill ZIP file to upload
Skill ZIP Structure
A valid skill ZIP file must contain aSKILL.md file at the root with YAML frontmatter containing name and description:
Initialize the client
First, create a client instance with your API key and base URL.Step-by-step tutorial
1
Upload a skill
Create a new skill by uploading a ZIP file. The skill name and description are extracted from the The skill object contains:
SKILL.md file inside the ZIP.id: Unique skill identifier (UUID)name: Skill name from SKILL.mddescription: Skill description from SKILL.mdfile_index: List of files with paths and MIME typesmeta: Your custom metadatacreated_at: ISO 8601 timestampupdated_at: ISO 8601 timestamp
Save the skill ID - you’ll need it to retrieve files and manage the skill.
2
Browse the skill catalog
List all available skills with their names and descriptions. This is useful for discovering what skills are available.
The catalog only returns names and descriptions for efficient browsing. Use
get() to retrieve full skill details including the file index.3
Get skill details
Retrieve full information about a skill, including its file index.
The
file_index contains all files in the skill with their relative paths and MIME types. Use this to understand the skill’s structure before reading specific files.4
Read a file from the skill
Retrieve the contents of a specific file from the skill. Text files return parsed content, while binary files return a presigned download URL.The response includes:
path: File path within the skillmime: MIME type of the filecontent: Parsed content for text files (markdown, code, JSON, etc.)url: Presigned download URL for binary files (images, PDFs, etc.)
5
Read additional files
Read other files from the skill as needed, such as scripts, templates, or configuration files.
For binary files like images, the API returns a presigned URL instead of content. You can customize the URL expiration with the
expire parameter (in seconds, default 900).6
Delete a skill
Remove a skill when it’s no longer needed.
Complete example
Here’s a complete working example that demonstrates the full workflow:Advanced features
Pagination for skill catalog
Pagination for skill catalog
When you have many skills, use pagination to retrieve them in batches:
Filter skills by user
Filter skills by user
Filter skills by the user who created them:
Custom URL expiration
Custom URL expiration
Control how long presigned URLs remain valid for binary files:
Common use cases
Knowledge bases
Store domain-specific knowledge, best practices, and reference materials that agents can access when performing specialized tasks.
Code templates
Provide reusable code snippets, scripts, and templates that agents can adapt for specific use cases.
Workflow instructions
Define step-by-step procedures and decision trees that guide agents through complex processes.
Tool configurations
Store API schemas, configuration files, and integration guides that help agents interact with external services.
Where to find skills
Anthropic Skills Repository
Browse and download pre-built skills from Anthropic’s open-source skills repository. Each folder is a skill you can zip and upload.
Troubleshooting
Invalid ZIP file error
Invalid ZIP file error
Problem: Getting an error when uploading a skill ZIP.Solution:
- Ensure the ZIP contains a
SKILL.mdfile at the root level - Check that
SKILL.mdhas valid YAML frontmatter withnameanddescription - Verify the ZIP is not corrupted
File not found in skill
File not found in skill
Problem: Getting a 404 error when reading a file from a skill.Solution:
- Use
client.skills.get(skill_id)to see thefile_indexand verify the file exists - Ensure the
file_pathmatches exactly (case-sensitive) - Check for leading slashes - paths should be relative (e.g.,
scripts/main.py, not/scripts/main.py)
Duplicate skill name
Duplicate skill name
Problem: Error when uploading a skill with a name that already exists.Solution:
- Skill names must be unique within your project
- Either delete the existing skill first, or use a different name in your
SKILL.md