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.
package hello.world;
import com.glean.api_client.glean_api_client.Glean;
import com.glean.api_client.glean_api_client.models.components.PlatformSkillCreateRequest;
import com.glean.api_client.glean_api_client.models.components.PlatformSkillCreateRequestFile;
import com.glean.api_client.glean_api_client.models.errors.PlatformProblemDetailException;
import com.glean.api_client.glean_api_client.models.operations.PlatformSkillsCreateResponse;
import com.glean.api_client.glean_api_client.utils.Utils;
import java.io.FileInputStream;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws PlatformProblemDetailException, Exception {
Glean sdk = Glean.builder()
.apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", ""))
.build();
PlatformSkillCreateRequest req = PlatformSkillCreateRequest.builder()
.file(PlatformSkillCreateRequestFile.builder()
.fileName("example.file")
.content(Utils.readBytesAndClose(new FileInputStream("example.file")))
.build())
.build();
PlatformSkillsCreateResponse res = sdk.skills().create()
.request(req)
.call();
}
}
PlatformSkillsCreateResponse
| Error Type |
Status Code |
Content Type |
| models/errors/PlatformProblemDetailException |
400, 401, 403, 404, 408, 409, 413, 429 |
application/problem+json |
| models/errors/PlatformProblemDetailException |
500, 503 |
application/problem+json |
| models/errors/APIException |
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.
package hello.world;
import com.glean.api_client.glean_api_client.Glean;
import com.glean.api_client.glean_api_client.models.errors.PlatformProblemDetailException;
import com.glean.api_client.glean_api_client.models.operations.PlatformSkillsListResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws PlatformProblemDetailException, Exception {
Glean sdk = Glean.builder()
.apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", ""))
.build();
PlatformSkillsListResponse res = sdk.skills().list()
.pageSize(20L)
.call();
if (res.platformSkillsListResponse().isPresent()) {
System.out.println(res.platformSkillsListResponse().get());
}
}
}
| Parameter |
Type |
Required |
Description |
pageSize |
Optional<Long> |
➖ |
Maximum number of skills to return. Defaults to 20. Maximum is 100. |
cursor |
Optional<String> |
➖ |
Opaque pagination cursor from a previous response. |
PlatformSkillsListResponse
| Error Type |
Status Code |
Content Type |
| models/errors/PlatformProblemDetailException |
400, 401, 403, 404, 408, 429 |
application/problem+json |
| models/errors/PlatformProblemDetailException |
500, 503 |
application/problem+json |
| models/errors/APIException |
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.
package hello.world;
import com.glean.api_client.glean_api_client.Glean;
import com.glean.api_client.glean_api_client.models.components.PlatformSkillImportRequest;
import com.glean.api_client.glean_api_client.models.errors.PlatformProblemDetailException;
import com.glean.api_client.glean_api_client.models.errors.PlatformUnauthorizedAgentToolsProblemException;
import com.glean.api_client.glean_api_client.models.operations.PlatformSkillsImportResponse;
import java.lang.Exception;
import java.util.List;
public class Application {
public static void main(String[] args) throws PlatformUnauthorizedAgentToolsProblemException, PlatformProblemDetailException, Exception {
Glean sdk = Glean.builder()
.apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", ""))
.build();
PlatformSkillImportRequest req = PlatformSkillImportRequest.builder()
.sourceUrls(List.of(
"https://github.com/anthropics/skills/tree/main/skills/skill-creator"))
.build();
PlatformSkillsImportResponse res = sdk.skills().import_()
.request(req)
.call();
if (res.platformSkillImportResponse().isPresent()) {
System.out.println(res.platformSkillImportResponse().get());
}
}
}
PlatformSkillsImportResponse
| Error Type |
Status Code |
Content Type |
| models/errors/PlatformUnauthorizedAgentToolsProblemException |
422 |
application/problem+json |
| models/errors/PlatformProblemDetailException |
400, 401, 403, 408, 409, 413, 429 |
application/problem+json |
| models/errors/PlatformProblemDetailException |
500, 503 |
application/problem+json |
| models/errors/APIException |
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.
package hello.world;
import com.glean.api_client.glean_api_client.Glean;
import com.glean.api_client.glean_api_client.models.components.PlatformSkillValidationRequest;
import com.glean.api_client.glean_api_client.models.components.PlatformSkillValidationRequestFile;
import com.glean.api_client.glean_api_client.models.errors.PlatformProblemDetailException;
import com.glean.api_client.glean_api_client.models.operations.PlatformSkillsValidateResponse;
import com.glean.api_client.glean_api_client.utils.Utils;
import java.io.FileInputStream;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws PlatformProblemDetailException, Exception {
Glean sdk = Glean.builder()
.apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", ""))
.build();
PlatformSkillValidationRequest req = PlatformSkillValidationRequest.builder()
.file(PlatformSkillValidationRequestFile.builder()
.fileName("example.file")
.content(Utils.readBytesAndClose(new FileInputStream("example.file")))
.build())
.build();
PlatformSkillsValidateResponse res = sdk.skills().validate()
.request(req)
.call();
}
}
PlatformSkillsValidateResponse
| Error Type |
Status Code |
Content Type |
| models/errors/PlatformProblemDetailException |
400, 401, 403, 404, 408, 413, 429 |
application/problem+json |
| models/errors/PlatformProblemDetailException |
500, 503 |
application/problem+json |
| models/errors/APIException |
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.
package hello.world;
import com.glean.api_client.glean_api_client.Glean;
import com.glean.api_client.glean_api_client.models.errors.PlatformProblemDetailException;
import com.glean.api_client.glean_api_client.models.errors.PlatformUnauthorizedAgentToolsProblemException;
import com.glean.api_client.glean_api_client.models.operations.PlatformSkillsPreviewSourceRequest;
import com.glean.api_client.glean_api_client.models.operations.PlatformSkillsPreviewSourceResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws PlatformUnauthorizedAgentToolsProblemException, PlatformProblemDetailException, Exception {
Glean sdk = Glean.builder()
.apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", ""))
.build();
PlatformSkillsPreviewSourceRequest req = PlatformSkillsPreviewSourceRequest.builder()
.sourceUrl("https://github.com/anthropics/skills")
.build();
PlatformSkillsPreviewSourceResponse res = sdk.skills().previewSource()
.request(req)
.call();
if (res.platformSkillSourcePreviewResponse().isPresent()) {
System.out.println(res.platformSkillSourcePreviewResponse().get());
}
}
}
PlatformSkillsPreviewSourceResponse
| Error Type |
Status Code |
Content Type |
| models/errors/PlatformUnauthorizedAgentToolsProblemException |
422 |
application/problem+json |
| models/errors/PlatformProblemDetailException |
400, 401, 403, 408, 413, 429 |
application/problem+json |
| models/errors/PlatformProblemDetailException |
500, 503 |
application/problem+json |
| models/errors/APIException |
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.
package hello.world;
import com.glean.api_client.glean_api_client.Glean;
import com.glean.api_client.glean_api_client.models.components.PlatformSkillUpdateRequest;
import com.glean.api_client.glean_api_client.models.components.PlatformSkillUpdateStatus;
import com.glean.api_client.glean_api_client.models.errors.PlatformProblemDetailException;
import com.glean.api_client.glean_api_client.models.operations.PlatformSkillsUpdateResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws PlatformProblemDetailException, Exception {
Glean sdk = Glean.builder()
.apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", ""))
.build();
PlatformSkillsUpdateResponse res = sdk.skills().update()
.skillId("{skill_id}")
.platformSkillUpdateRequest(PlatformSkillUpdateRequest.builder()
.status(PlatformSkillUpdateStatus.ENABLED)
.build())
.call();
if (res.platformSkillUpdateResponse().isPresent()) {
System.out.println(res.platformSkillUpdateResponse().get());
}
}
}
| Parameter |
Type |
Required |
Description |
Example |
skillId |
String |
✔️ |
Glean skill ID. |
{skill_id} |
platformSkillUpdateRequest |
PlatformSkillUpdateRequest |
✔️ |
N/A |
{ "status": "ENABLED" } |
PlatformSkillsUpdateResponse
| Error Type |
Status Code |
Content Type |
| models/errors/PlatformProblemDetailException |
400, 401, 403, 404, 408, 409, 413, 429 |
application/problem+json |
| models/errors/PlatformProblemDetailException |
500, 503 |
application/problem+json |
| models/errors/APIException |
4XX, 5XX |
*/* |
Delete a skill the authenticated caller is allowed to manage. This operation permanently removes all versions of the skill.
package hello.world;
import com.glean.api_client.glean_api_client.Glean;
import com.glean.api_client.glean_api_client.models.errors.PlatformProblemDetailException;
import com.glean.api_client.glean_api_client.models.operations.PlatformSkillsDeleteResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws PlatformProblemDetailException, Exception {
Glean sdk = Glean.builder()
.apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", ""))
.build();
PlatformSkillsDeleteResponse res = sdk.skills().delete()
.skillId("{skill_id}")
.call();
// handle response
}
}
| Parameter |
Type |
Required |
Description |
Example |
skillId |
String |
✔️ |
Glean skill ID. |
{skill_id} |
PlatformSkillsDeleteResponse
| Error Type |
Status Code |
Content Type |
| models/errors/PlatformProblemDetailException |
400, 401, 403, 404, 408, 429 |
application/problem+json |
| models/errors/PlatformProblemDetailException |
500, 503 |
application/problem+json |
| models/errors/APIException |
4XX, 5XX |
*/* |
Retrieve metadata for a skill available to the authenticated user.
package hello.world;
import com.glean.api_client.glean_api_client.Glean;
import com.glean.api_client.glean_api_client.models.errors.PlatformProblemDetailException;
import com.glean.api_client.glean_api_client.models.operations.PlatformSkillsGetResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws PlatformProblemDetailException, Exception {
Glean sdk = Glean.builder()
.apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", ""))
.build();
PlatformSkillsGetResponse res = sdk.skills().retrieve()
.skillId("{skill_id}")
.call();
if (res.platformSkillGetResponse().isPresent()) {
System.out.println(res.platformSkillGetResponse().get());
}
}
}
| Parameter |
Type |
Required |
Description |
Example |
skillId |
String |
✔️ |
Glean skill ID. |
{skill_id} |
PlatformSkillsGetResponse
| Error Type |
Status Code |
Content Type |
| models/errors/PlatformProblemDetailException |
400, 401, 403, 404, 408, 429 |
application/problem+json |
| models/errors/PlatformProblemDetailException |
500, 503 |
application/problem+json |
| models/errors/APIException |
4XX, 5XX |
*/* |
Download the latest installable bundle for a skill available to the authenticated user.
package hello.world;
import com.glean.api_client.glean_api_client.Glean;
import com.glean.api_client.glean_api_client.models.errors.PlatformProblemDetailException;
import com.glean.api_client.glean_api_client.models.operations.PlatformSkillsGetContentResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws PlatformProblemDetailException, Exception {
Glean sdk = Glean.builder()
.apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", ""))
.build();
PlatformSkillsGetContentResponse res = sdk.skills().retrieveContent()
.skillId("{skill_id}")
.call();
if (res.responseStream().isPresent()) {
// handle response
}
}
}
| Parameter |
Type |
Required |
Description |
Example |
skillId |
String |
✔️ |
Glean skill ID. |
{skill_id} |
PlatformSkillsGetContentResponse
| Error Type |
Status Code |
Content Type |
| models/errors/PlatformProblemDetailException |
400, 401, 403, 404, 408, 429 |
application/problem+json |
| models/errors/PlatformProblemDetailException |
500, 503 |
application/problem+json |
| models/errors/APIException |
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.
package hello.world;
import com.glean.api_client.glean_api_client.Glean;
import com.glean.api_client.glean_api_client.models.errors.PlatformProblemDetailException;
import com.glean.api_client.glean_api_client.models.errors.PlatformUnauthorizedAgentToolsProblemException;
import com.glean.api_client.glean_api_client.models.operations.PlatformSkillsSyncResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws PlatformUnauthorizedAgentToolsProblemException, PlatformProblemDetailException, Exception {
Glean sdk = Glean.builder()
.apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", ""))
.build();
PlatformSkillsSyncResponse res = sdk.skills().sync()
.skillId("{skill_id}")
.call();
if (res.platformSkillSyncResponse().isPresent()) {
System.out.println(res.platformSkillSyncResponse().get());
}
}
}
| Parameter |
Type |
Required |
Description |
Example |
skillId |
String |
✔️ |
ID of the GitHub-imported skill to sync. |
{skill_id} |
PlatformSkillsSyncResponse
| Error Type |
Status Code |
Content Type |
| models/errors/PlatformUnauthorizedAgentToolsProblemException |
422 |
application/problem+json |
| models/errors/PlatformProblemDetailException |
400, 401, 403, 404, 408, 409, 429 |
application/problem+json |
| models/errors/PlatformProblemDetailException |
500, 503 |
application/problem+json |
| models/errors/APIException |
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.
package hello.world;
import com.glean.api_client.glean_api_client.Glean;
import com.glean.api_client.glean_api_client.models.components.PlatformSkillVersionCreateRequest;
import com.glean.api_client.glean_api_client.models.components.PlatformSkillVersionCreateRequestFile;
import com.glean.api_client.glean_api_client.models.errors.PlatformProblemDetailException;
import com.glean.api_client.glean_api_client.models.operations.PlatformSkillsCreateVersionResponse;
import com.glean.api_client.glean_api_client.utils.Utils;
import java.io.FileInputStream;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws PlatformProblemDetailException, Exception {
Glean sdk = Glean.builder()
.apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", ""))
.build();
PlatformSkillsCreateVersionResponse res = sdk.skills().createVersion()
.skillId("{skill_id}")
.platformSkillVersionCreateRequest(PlatformSkillVersionCreateRequest.builder()
.file(PlatformSkillVersionCreateRequestFile.builder()
.fileName("example.file")
.content(Utils.readBytesAndClose(new FileInputStream("example.file")))
.build())
.build())
.call();
}
}
PlatformSkillsCreateVersionResponse
| Error Type |
Status Code |
Content Type |
| models/errors/PlatformProblemDetailException |
400, 401, 403, 404, 408, 409, 413, 429 |
application/problem+json |
| models/errors/PlatformProblemDetailException |
500, 503 |
application/problem+json |
| models/errors/APIException |
4XX, 5XX |
*/* |
List versions for a skill available to the authenticated user.
package hello.world;
import com.glean.api_client.glean_api_client.Glean;
import com.glean.api_client.glean_api_client.models.errors.PlatformProblemDetailException;
import com.glean.api_client.glean_api_client.models.operations.PlatformSkillsListVersionsResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws PlatformProblemDetailException, Exception {
Glean sdk = Glean.builder()
.apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", ""))
.build();
PlatformSkillsListVersionsResponse res = sdk.skills().listVersions()
.skillId("{skill_id}")
.pageSize(20L)
.call();
if (res.platformSkillVersionsListResponse().isPresent()) {
System.out.println(res.platformSkillVersionsListResponse().get());
}
}
}
| Parameter |
Type |
Required |
Description |
Example |
skillId |
String |
✔️ |
Glean skill ID. |
{skill_id} |
pageSize |
Optional<Long> |
➖ |
Maximum number of versions to return. Defaults to 20. Maximum is 100. |
|
cursor |
Optional<String> |
➖ |
Opaque pagination cursor from a previous response. |
|
PlatformSkillsListVersionsResponse
| Error Type |
Status Code |
Content Type |
| models/errors/PlatformProblemDetailException |
400, 401, 403, 404, 408, 429 |
application/problem+json |
| models/errors/PlatformProblemDetailException |
500, 503 |
application/problem+json |
| models/errors/APIException |
4XX, 5XX |
*/* |
Retrieve metadata for a skill version available to the authenticated user.
package hello.world;
import com.glean.api_client.glean_api_client.Glean;
import com.glean.api_client.glean_api_client.models.errors.PlatformProblemDetailException;
import com.glean.api_client.glean_api_client.models.operations.PlatformSkillsGetVersionResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws PlatformProblemDetailException, Exception {
Glean sdk = Glean.builder()
.apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", ""))
.build();
PlatformSkillsGetVersionResponse res = sdk.skills().retrieveVersion()
.skillId("{skill_id}")
.version(1L)
.call();
if (res.platformSkillVersionGetResponse().isPresent()) {
System.out.println(res.platformSkillVersionGetResponse().get());
}
}
}
| Parameter |
Type |
Required |
Description |
Example |
skillId |
String |
✔️ |
Glean skill ID. |
{skill_id} |
version |
long |
✔️ |
Major version number. |
1 |
PlatformSkillsGetVersionResponse
| Error Type |
Status Code |
Content Type |
| models/errors/PlatformProblemDetailException |
400, 401, 403, 404, 408, 429 |
application/problem+json |
| models/errors/PlatformProblemDetailException |
500, 503 |
application/problem+json |
| models/errors/APIException |
4XX, 5XX |
*/* |
Download the installable bundle for a skill version available to the authenticated user.
package hello.world;
import com.glean.api_client.glean_api_client.Glean;
import com.glean.api_client.glean_api_client.models.errors.PlatformProblemDetailException;
import com.glean.api_client.glean_api_client.models.operations.PlatformSkillsGetVersionContentResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws PlatformProblemDetailException, Exception {
Glean sdk = Glean.builder()
.apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", ""))
.build();
PlatformSkillsGetVersionContentResponse res = sdk.skills().retrieveVersionContent()
.skillId("{skill_id}")
.version(1L)
.call();
if (res.responseStream().isPresent()) {
// handle response
}
}
}
| Parameter |
Type |
Required |
Description |
Example |
skillId |
String |
✔️ |
Glean skill ID. |
{skill_id} |
version |
long |
✔️ |
Major version number. |
1 |
PlatformSkillsGetVersionContentResponse
| Error Type |
Status Code |
Content Type |
| models/errors/PlatformProblemDetailException |
400, 401, 403, 404, 408, 429 |
application/problem+json |
| models/errors/PlatformProblemDetailException |
500, 503 |
application/problem+json |
| models/errors/APIException |
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.
package hello.world;
import com.glean.api_client.glean_api_client.Glean;
import com.glean.api_client.glean_api_client.models.components.PlatformSkillSourcePreviewStreamEventServerSentEvent;
import com.glean.api_client.glean_api_client.models.errors.PlatformProblemDetailException;
import com.glean.api_client.glean_api_client.models.errors.PlatformUnauthorizedAgentToolsProblemException;
import com.glean.api_client.glean_api_client.models.operations.PlatformSkillsPreviewSourceStreamRequest;
import com.glean.api_client.glean_api_client.models.operations.PlatformSkillsPreviewSourceStreamResponse;
import com.glean.api_client.glean_api_client.utils.EventStream;
import java.lang.Exception;
import java.util.stream.Stream;
public class Application {
public static void main(String[] args) throws PlatformUnauthorizedAgentToolsProblemException, PlatformProblemDetailException, Exception {
Glean sdk = Glean.builder()
.apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", ""))
.build();
PlatformSkillsPreviewSourceStreamRequest req = PlatformSkillsPreviewSourceStreamRequest.builder()
.sourceUrl("https://github.com/anthropics/skills")
.build();
PlatformSkillsPreviewSourceStreamResponse res = sdk.skills().previewSourceStream()
.request(req)
.call();
// handle event stream, must be closed after use!
try (EventStream<PlatformSkillSourcePreviewStreamEventServerSentEvent> events = res.events()) {
// Option 1: Use for-each loop
for (PlatformSkillSourcePreviewStreamEventServerSentEvent event : events) {
System.out.println(event);
}
// Option 2: Use Stream API
try (Stream<PlatformSkillSourcePreviewStreamEventServerSentEvent> stream = events.stream()) {
stream.forEach(System.out::println);
}
}
}
}
PlatformSkillsPreviewSourceStreamResponse
| Error Type |
Status Code |
Content Type |
| models/errors/PlatformUnauthorizedAgentToolsProblemException |
422 |
application/problem+json |
| models/errors/PlatformProblemDetailException |
400, 401, 403, 408, 413, 429 |
application/problem+json |
| models/errors/PlatformProblemDetailException |
500, 503 |
application/problem+json |
| models/errors/APIException |
4XX, 5XX |
*/* |