MetorialDocs

Skill Files

Read and edit the files of a skill by path.

The Skill File object

skill_file.json
{
  "object": "skill.mcp_availability",
  "skill_id": "example_skill_id",
  "available": false,
  "exceeded_limits": [
    "file_count",
    "file_count"
  ],
  "file_count": 0,
  "size": 0,
  "max_file_count": 0,
  "max_size": 0
}
object"skill.mcp_availability"required
skill_idstringrequired
availablebooleanrequired
exceeded_limits"file_count" | "size"[]required
file_countnumberrequired
sizenumberrequired
max_file_countnumberrequired
max_sizenumberrequired

Endpoints

List skill files

GET/skills/:skill_id/files

Lists every file of a skill with its path, size and etag. Directories are implied by file paths.

Path parameters

skill_idstringrequired

The unique identifier for the skill

Example request

curl -X GET "https://api.metorial.com/skills/ski_Rm4Mnheq2bfEPhBhP7SY/files" \
  -H "Authorization: Bearer metorial_sk_io2h4..."

Get skill MCP availability

GET/skills/:skill_id/mcp-availability

Returns whether apps connected over MCP can see the skill. Skills with too many files or too large a total size are left out of MCP connections and keep working everywhere else.

Path parameters

skill_idstringrequired

The unique identifier for the skill

Example request

curl -X GET "https://api.metorial.com/skills/ski_Rm4Mnheq2bfEPhBhP7SY/mcp-availability" \
  -H "Authorization: Bearer metorial_sk_io2h4..."

Get skill file

GET/skills/:skill_id/files/content

Retrieves a single skill file by path. Documents include their text content, other files include a download URL.

Path parameters

skill_idstringrequired

The unique identifier for the skill

Query parameters

pathstringrequired

Path of the file inside the skill. A leading "/" is optional. Paths may contain letters, numbers, spaces and the characters . _ - ( ) $.

Example request

curl -X GET "https://api.metorial.com/skills/ski_Rm4Mnheq2bfEPhBhP7SY/files/content" \
  -H "Authorization: Bearer metorial_sk_io2h4..."

Write skill file

PUT/skills/:skill_id/files

Creates or replaces the file at a path. Parent directories are created automatically.

Path parameters

skill_idstringrequired

The unique identifier for the skill

Request body

pathstringrequired

Path of the file inside the skill. A leading "/" is optional. Paths may contain letters, numbers, spaces and the characters . _ - ( ) $.

contentstringoptional

The new text content of the file. Markdown files are stored as documents, other files as plain text files.

file_idstringoptional

The ID of a previously uploaded file to place at the path. Use this for binary files. Files that belong to a document cannot be attached; use content to write markdown documents.

if_matchstringoptionalnullable

Only apply the change if the file still has this etag. Pass null to require that no file exists at the path yet. Omit to skip the check.

Example request

curl -X PUT "https://api.metorial.com/skills/ski_Rm4Mnheq2bfEPhBhP7SY/files" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer metorial_sk_io2h4..." \
  -d '{
  "path": "/SKILL.md",
  "content": "example_content",
  "file_id": "example_file_id",
  "if_match": "example_if_match"
}'

Delete skill file

DELETE/skills/:skill_id/files

Deletes the file at a path. Directories that were created automatically and become empty are removed. The root SKILL.md cannot be deleted.

Path parameters

skill_idstringrequired

The unique identifier for the skill

Query parameters

pathstringrequired

Path of the file inside the skill. A leading "/" is optional. Paths may contain letters, numbers, spaces and the characters . _ - ( ) $.

if_matchstringoptional

Only apply the change if the file still has this etag. Omit to skip the check.

Example request

curl -X DELETE "https://api.metorial.com/skills/ski_Rm4Mnheq2bfEPhBhP7SY/files" \
  -H "Authorization: Bearer metorial_sk_io2h4..."

Move skill file

POST/skills/:skill_id/files/move

Moves or renames a file. The root SKILL.md cannot be moved.

Path parameters

skill_idstringrequired

The unique identifier for the skill

Request body

pathstringrequired

Path of the file inside the skill. A leading "/" is optional. Paths may contain letters, numbers, spaces and the characters . _ - ( ) $.

to_pathstringrequired

The new path of the file.

if_matchstringoptional

Only apply the change if the file still has this etag. Omit to skip the check.

Example request

curl -X POST "https://api.metorial.com/skills/ski_Rm4Mnheq2bfEPhBhP7SY/files/move" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer metorial_sk_io2h4..." \
  -d '{
  "path": "/SKILL.md",
  "to_path": "/references/renamed.md",
  "if_match": "example_if_match"
}'

Apply skill file changes

POST/skills/:skill_id/files/batch

Applies up to 100 put, delete and move changes one after another, in order. Every change is validated before any is applied, but changes are not applied atomically: if a change fails while being applied, the changes before it stay applied. Every change can carry its own if_match precondition.

Path parameters

skill_idstringrequired

The unique identifier for the skill

Request body

Example request

curl -X POST "https://api.metorial.com/skills/ski_Rm4Mnheq2bfEPhBhP7SY/files/batch" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer metorial_sk_io2h4..." \
  -d '{
  "changes": [
    {
      "type": "put",
      "path": "/SKILL.md"
    },
    {
      "type": "put",
      "path": "/SKILL.md"
    }
  ]
}'