fastmcp.skills.skill
Storage-neutral agent skills.
Classes
Skill
An agent skill: a SKILL.md plus supporting files, independent of storage.
A Skill holds exact file bytes. It doesnβt know where it came from or which
URI it is served under; a provider decides that. Author one in Python with the
keyword constructor, or snapshot one from a directory, package, or mapping of
files.
Methods:
from_files
files must include SKILL.md with valid frontmatter.
from_directory
name in its SKILL.md. Symlinks and
special files are rejected, so a snapshot never reaches outside the folder.
from_package
("my_pkg", "skills/review").
to_directory
path, a folder named after the skill.
The folder name must match the skillβs name, so from_directory can
read it back. An existing folder raises FileExistsError unless
overwrite is set, in which case it is replaced: files that arenβt
part of the skill are removed. Files are staged before replacing an
existing folder. If replacement and restoration both fail, the error
identifies where the previous folder has been retained.
name
description
frontmatter
files
SKILL.md.
to_mcp_skill
skill://{path}/.