Create a skill from an uploaded SKILL.md, .zip, or .skill bundle. If the authenticated user already has a skill with the same name, the existing skill is superseded with a new version, unless it is source-managed: a same-name create over a GitHub-imported skill returns 409, and the caller syncs the existing skill instead. Two concurrent same-name creates can still produce two skills.
from glean.api_client import Glean
import os
with Glean(
api_token=os.getenv("GLEAN_API_TOKEN", ""),
) as glean:
res = glean.skills.create(file={
"file_name": "example.file",
"content": open("example.file", "rb"),
})
# Handle response
print(res)
models.PlatformSkillCreateResponse
| Error Type |
Status Code |
Content Type |
| errors.PlatformProblemDetailError |
400, 401, 403, 404, 408, 409, 413, 429 |
application/problem+json |
| errors.PlatformProblemDetailError |
500, 503 |
application/problem+json |
| errors.GleanError |
4XX, 5XX |
*/* |
List every custom skill the authenticated caller can access. Built-in skills are excluded: they have no versions, content download, update, or delete, so their identifiers would fail most skill operations. Chat-authored skills shared with the caller without a listed grant are omitted: they stay retrievable by identifier when it is known, but this list does not discover them.
from glean.api_client import Glean
import os
with Glean(
api_token=os.getenv("GLEAN_API_TOKEN", ""),
) as glean:
res = glean.skills.list(page_size=20)
# Handle response
print(res)
| Parameter |
Type |
Required |
Description |
page_size |
Optional[int] |
➖ |
Maximum number of skills to return. Defaults to 20. Maximum is 100. |
cursor |
Optional[str] |
➖ |
Opaque pagination cursor from a previous response. |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
models.PlatformSkillsListResponse
| Error Type |
Status Code |
Content Type |
| errors.PlatformProblemDetailError |
400, 401, 403, 404, 408, 429 |
application/problem+json |
| errors.PlatformProblemDetailError |
500, 503 |
application/problem+json |
| errors.GleanError |
4XX, 5XX |
*/* |
Import one or more skills selected from a GitHub source preview. Each source URL is fetched and persisted as an independent skill with source provenance. This operation does not create a durable source resource. The import is atomic: if any source cannot be fetched, validated, or persisted, no skills are created.
from glean.api_client import Glean
import os
with Glean(
api_token=os.getenv("GLEAN_API_TOKEN", ""),
) as glean:
res = glean.skills.import_(source_urls=[
"https://github.com/anthropics/skills/tree/main/skills/skill-creator",
])
# Handle response
print(res)
| Parameter |
Type |
Required |
Description |
source_urls |
List[str] |
✔️ |
Resolved GitHub skill URLs selected from a source preview. |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
models.PlatformSkillImportResponse
| Error Type |
Status Code |
Content Type |
| errors.PlatformUnauthorizedAgentToolsProblemError |
422 |
application/problem+json |
| errors.PlatformProblemDetailError |
400, 401, 403, 408, 409, 413, 429 |
application/problem+json |
| errors.PlatformProblemDetailError |
500, 503 |
application/problem+json |
| errors.GleanError |
4XX, 5XX |
*/* |
Validate a skill bundle without persisting it. Accepts a SKILL.md, .zip, or .skill upload and returns parsed metadata plus the normalized file layout.
from glean.api_client import Glean
import os
with Glean(
api_token=os.getenv("GLEAN_API_TOKEN", ""),
) as glean:
res = glean.skills.validate(file={
"file_name": "example.file",
"content": open("example.file", "rb"),
})
# Handle response
print(res)
models.PlatformSkillValidationResponse
| Error Type |
Status Code |
Content Type |
| errors.PlatformProblemDetailError |
400, 401, 403, 404, 408, 413, 429 |
application/problem+json |
| errors.PlatformProblemDetailError |
500, 503 |
application/problem+json |
| errors.GleanError |
4XX, 5XX |
*/* |
Inspect a GitHub URL without persisting a source or any discovered skills. Set stream to true to receive repository scan progress as server-sent events; otherwise the response contains the completed preview.
from glean.api_client import Glean
import os
with Glean(
api_token=os.getenv("GLEAN_API_TOKEN", ""),
) as glean:
res = glean.skills.preview_source(source_url="https://github.com/anthropics/skills")
# Handle response
print(res)
| Parameter |
Type |
Required |
Description |
source_url |
str |
✔️ |
GitHub URL for a skill directory, SKILL.md file, or repository to inspect. |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
models.PlatformSkillSourcePreviewResponse
| Error Type |
Status Code |
Content Type |
| errors.PlatformUnauthorizedAgentToolsProblemError |
422 |
application/problem+json |
| errors.PlatformProblemDetailError |
400, 401, 403, 408, 413, 429 |
application/problem+json |
| errors.PlatformProblemDetailError |
500, 503 |
application/problem+json |
| errors.GleanError |
4XX, 5XX |
*/* |
Enable or disable the skill for the authenticated caller without changing its content. The owner's update sets the skill's stored status. Any other caller's update applies only to that caller.
from glean.api_client import Glean, models
import os
with Glean(
api_token=os.getenv("GLEAN_API_TOKEN", ""),
) as glean:
res = glean.skills.update(skill_id="{skill_id}", status=models.PlatformSkillUpdateStatus.ENABLED)
# Handle response
print(res)
| Parameter |
Type |
Required |
Description |
Example |
skill_id |
str |
✔️ |
Glean skill ID. |
{skill_id} |
status |
models.PlatformSkillUpdateStatus |
✔️ |
Activation to apply for the authenticated caller. For the owner, this updates the skill's stored status. For any other caller, it updates only that caller's setting.
|
|
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
|
models.PlatformSkillUpdateResponse
| Error Type |
Status Code |
Content Type |
| errors.PlatformProblemDetailError |
400, 401, 403, 404, 408, 409, 413, 429 |
application/problem+json |
| errors.PlatformProblemDetailError |
500, 503 |
application/problem+json |
| errors.GleanError |
4XX, 5XX |
*/* |
Delete a skill the authenticated caller is allowed to manage. This operation permanently removes all versions of the skill.
from glean.api_client import Glean
import os
with Glean(
api_token=os.getenv("GLEAN_API_TOKEN", ""),
) as glean:
glean.skills.delete(skill_id="{skill_id}")
# Use the SDK ...
| Parameter |
Type |
Required |
Description |
Example |
skill_id |
str |
✔️ |
Glean skill ID. |
{skill_id} |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
|
| Error Type |
Status Code |
Content Type |
| errors.PlatformProblemDetailError |
400, 401, 403, 404, 408, 429 |
application/problem+json |
| errors.PlatformProblemDetailError |
500, 503 |
application/problem+json |
| errors.GleanError |
4XX, 5XX |
*/* |
Retrieve metadata for a skill available to the authenticated user.
from glean.api_client import Glean
import os
with Glean(
api_token=os.getenv("GLEAN_API_TOKEN", ""),
) as glean:
res = glean.skills.retrieve(skill_id="{skill_id}")
# Handle response
print(res)
| Parameter |
Type |
Required |
Description |
Example |
skill_id |
str |
✔️ |
Glean skill ID. |
{skill_id} |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
|
models.PlatformSkillGetResponse
| Error Type |
Status Code |
Content Type |
| errors.PlatformProblemDetailError |
400, 401, 403, 404, 408, 429 |
application/problem+json |
| errors.PlatformProblemDetailError |
500, 503 |
application/problem+json |
| errors.GleanError |
4XX, 5XX |
*/* |
Download the latest installable bundle for a skill available to the authenticated user.
from glean.api_client import Glean
import os
with Glean(
api_token=os.getenv("GLEAN_API_TOKEN", ""),
) as glean:
res = glean.skills.retrieve_content(skill_id="{skill_id}")
# Handle response
print(res)
| Parameter |
Type |
Required |
Description |
Example |
skill_id |
str |
✔️ |
Glean skill ID. |
{skill_id} |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
|
models.PlatformSkillsGetContentResponse
| Error Type |
Status Code |
Content Type |
| errors.PlatformProblemDetailError |
400, 401, 403, 404, 408, 429 |
application/problem+json |
| errors.PlatformProblemDetailError |
500, 503 |
application/problem+json |
| errors.GleanError |
4XX, 5XX |
*/* |
Refresh one GitHub-imported skill from its stored source URL. If the skill content has changed, this operation creates a new skill version. If the skill is no longer present upstream, the stored skill is left unchanged and must be deleted explicitly.
from glean.api_client import Glean
import os
with Glean(
api_token=os.getenv("GLEAN_API_TOKEN", ""),
) as glean:
res = glean.skills.sync(skill_id="{skill_id}")
# Handle response
print(res)
| Parameter |
Type |
Required |
Description |
Example |
skill_id |
str |
✔️ |
ID of the GitHub-imported skill to sync. |
{skill_id} |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
|
models.PlatformSkillSyncResponse
| Error Type |
Status Code |
Content Type |
| errors.PlatformUnauthorizedAgentToolsProblemError |
422 |
application/problem+json |
| errors.PlatformProblemDetailError |
400, 401, 403, 404, 408, 409, 429 |
application/problem+json |
| errors.PlatformProblemDetailError |
500, 503 |
application/problem+json |
| errors.GleanError |
4XX, 5XX |
*/* |
Create a new immutable version for an existing caller-managed skill from an uploaded SKILL.md, .zip, or .skill bundle. A create-version over a GitHub-imported skill returns 409, and the caller syncs the existing skill instead.
from glean.api_client import Glean
import os
with Glean(
api_token=os.getenv("GLEAN_API_TOKEN", ""),
) as glean:
res = glean.skills.create_version(skill_id="{skill_id}", file={
"file_name": "example.file",
"content": open("example.file", "rb"),
})
# Handle response
print(res)
models.PlatformSkillVersionCreateResponse
| Error Type |
Status Code |
Content Type |
| errors.PlatformProblemDetailError |
400, 401, 403, 404, 408, 409, 413, 429 |
application/problem+json |
| errors.PlatformProblemDetailError |
500, 503 |
application/problem+json |
| errors.GleanError |
4XX, 5XX |
*/* |
List versions for a skill available to the authenticated user.
from glean.api_client import Glean
import os
with Glean(
api_token=os.getenv("GLEAN_API_TOKEN", ""),
) as glean:
res = glean.skills.list_versions(skill_id="{skill_id}", page_size=20)
# Handle response
print(res)
| Parameter |
Type |
Required |
Description |
Example |
skill_id |
str |
✔️ |
Glean skill ID. |
{skill_id} |
page_size |
Optional[int] |
➖ |
Maximum number of versions to return. Defaults to 20. Maximum is 100. |
|
cursor |
Optional[str] |
➖ |
Opaque pagination cursor from a previous response. |
|
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
|
models.PlatformSkillVersionsListResponse
| Error Type |
Status Code |
Content Type |
| errors.PlatformProblemDetailError |
400, 401, 403, 404, 408, 429 |
application/problem+json |
| errors.PlatformProblemDetailError |
500, 503 |
application/problem+json |
| errors.GleanError |
4XX, 5XX |
*/* |
Retrieve metadata for a skill version available to the authenticated user.
from glean.api_client import Glean
import os
with Glean(
api_token=os.getenv("GLEAN_API_TOKEN", ""),
) as glean:
res = glean.skills.retrieve_version(skill_id="{skill_id}", version=1)
# Handle response
print(res)
| Parameter |
Type |
Required |
Description |
Example |
skill_id |
str |
✔️ |
Glean skill ID. |
{skill_id} |
version |
int |
✔️ |
Major version number. |
1 |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
|
models.PlatformSkillVersionGetResponse
| Error Type |
Status Code |
Content Type |
| errors.PlatformProblemDetailError |
400, 401, 403, 404, 408, 429 |
application/problem+json |
| errors.PlatformProblemDetailError |
500, 503 |
application/problem+json |
| errors.GleanError |
4XX, 5XX |
*/* |
Download the installable bundle for a skill version available to the authenticated user.
from glean.api_client import Glean
import os
with Glean(
api_token=os.getenv("GLEAN_API_TOKEN", ""),
) as glean:
res = glean.skills.retrieve_version_content(skill_id="{skill_id}", version=1)
# Handle response
print(res)
| Parameter |
Type |
Required |
Description |
Example |
skill_id |
str |
✔️ |
Glean skill ID. |
{skill_id} |
version |
int |
✔️ |
Major version number. |
1 |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
|
models.PlatformSkillsGetVersionContentResponse
| Error Type |
Status Code |
Content Type |
| errors.PlatformProblemDetailError |
400, 401, 403, 404, 408, 429 |
application/problem+json |
| errors.PlatformProblemDetailError |
500, 503 |
application/problem+json |
| errors.GleanError |
4XX, 5XX |
*/* |
SDK-only logical operation. HTTP clients must call the base path; the URL fragment is not sent. Inspect a GitHub URL as server-sent events. HTTP clients request this mode by setting stream to true in the JSON body.
from glean.api_client import Glean
import os
with Glean(
api_token=os.getenv("GLEAN_API_TOKEN", ""),
) as glean:
res = glean.skills.preview_source_stream(source_url="https://github.com/anthropics/skills")
with res as event_stream:
for event in event_stream:
# handle event
print(event, flush=True)
| Parameter |
Type |
Required |
Description |
source_url |
str |
✔️ |
GitHub URL for a skill directory, SKILL.md file, or repository to inspect. |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
Union[eventstreaming.EventStream[models.PlatformSkillSourcePreviewStreamEventServerSentEvent], eventstreaming.EventStreamAsync[models.PlatformSkillSourcePreviewStreamEventServerSentEvent]]
| Error Type |
Status Code |
Content Type |
| errors.PlatformUnauthorizedAgentToolsProblemError |
422 |
application/problem+json |
| errors.PlatformProblemDetailError |
400, 401, 403, 408, 413, 429 |
application/problem+json |
| errors.PlatformProblemDetailError |
500, 503 |
application/problem+json |
| errors.GleanError |
4XX, 5XX |
*/* |