Check skill pack¶
Verify and preview the skill ZIP package to be imported without creating the skill or saving the file. Passing the check only means that the package conforms to the import format, and the import interface still needs to be called to create skills.
POST https://moi.matrixorigin.cn/newmoi/workspaces/{workspace_id}/skills/import/inspect
Before you call¶
Prepare a personal access token with access to the target workspace, the target workspace ID, and the local skills pack file.
The example below uses:
$AI_STUDIO_API_KEY: The actual personal access token, passed through theX-API-KeyHeader.$WORKSPACE_ID: Target workspace ID, passed throughX-Workspace-IDHeader.
The request type of this interface is multipart/form-data; the example uses curl -F to submit the file and do not add Content-Type: application/json.
The compressed package must contain one and only one SKILL.md. The file can be located in the root directory of the compressed package, or the only top-level directory; its YAML frontmatter must contain name and description, and the body must be non-empty instruction content.
Request example¶
curl -X POST "https://moi.matrixorigin.cn/newmoi/workspaces/$WORKSPACE_ID/skills/import/inspect" \
-H "X-API-Key: $AI_STUDIO_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-F "file=@./skill-package.zip"
Path parameters¶
Parameters |
Type |
Is it required |
Description |
|---|---|---|---|
|
string |
Yes |
The current workspace ID. |
Form fields¶
Field |
Type |
Is it required |
Description |
|---|---|---|---|
|
file |
Yes |
|
Successful response¶
Returns 200 and package preview on success. When the script file is included, warnings includes SKILL_PACKAGE_SCRIPTS_NOT_EXECUTABLE.
{
"code": 0,
"data": {
"name": "摘要技能",
"description": "总结输入内容。",
"category": "文本处理",
"tags": ["摘要"],
"instruction": "总结用户提供的内容。",
"files": [
{
"file_path": "SKILL.md",
"file_kind": "manifest",
"media_type": "text/markdown",
"sha256": "abc123",
"size_bytes": 512
}
],
"warnings": [],
"archive_digest": "sha256:abc123"
}
}
The response fields are as follows.
Field |
Type |
Description |
|---|---|---|
|
integer |
|
|
string |
Skill metadata read from the skill pack manifest. |
|
string |
Skill metadata read from the skill pack manifest. |
|
string |
Skill metadata read from the skill pack manifest. |
|
string[] |
Skill metadata read from the skill pack list. |
|
string |
The command text of |
|
array |
File metadata in the package. |
|
string |
Relative path, file category and media type. |
|
string |
Relative path, file category and media type. |
|
string |
Relative path, file category and media type. |
|
string |
Summary of file content and size. |
|
integer |
File content summary and size. |
|
string[] |
Non-blocking warning. |
|
string |
SHA-256 digest of the uploaded compressed package. |
[] after a type denotes an array. [] in a field path denotes each item in an array.
Error response¶
{
"code": 2,
"message": "<错误信息>",
"details": {
"reason": "SKILL_PACKAGE_INVALID_ZIP"
}
}
Common HTTP errors¶
HTTP status code |
error code |
Common causes |
Recommended actions |
|---|---|---|---|
|
|
The ZIP format, directory structure, |
Fix the skill pack according to |
|
|
The compressed package exceeds 50 MiB, or the total decompressed size exceeds 100 MiB. |
Reduce package size or remove unnecessary files. |
|
|
Lack of valid identity credentials. |
Check API Key. |
|
|
The current identity does not have the permission to check skill packages. |
Check workspace authorization. |
|
|
Skill services or authorized dependencies are temporarily unavailable. |
Try again later. |
Follow-up operations¶
After completion, Query skill details confirms the current status.