Repository navigation
Expand file tree
/
Copy pathSlackbotSkillsCreate.java
More file actions
39 lines (33 loc) · 1.63 KB
/
Copy pathSlackbotSkillsCreate.java
File metadata and controls
39 lines (33 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package slackbot.skills;
import com.slack.api.Slack;
import com.slack.api.methods.MethodsClient;
import com.slack.api.methods.SlackApiException;
import com.slack.api.methods.request.slackbot.skills.SlackbotSkillsCreateRequest;
import com.slack.api.methods.response.slackbot.skills.SlackbotSkillsCreateResponse;
import com.slack.api.model.slackbot.SkillMcpServer;
import java.io.IOException;
import java.util.Arrays;
public class SlackbotSkillsCreate {
public static void main(String[] args) throws IOException, SlackApiException {
// Read a token from an environment variable
String token = System.getenv("SLACK_TOKEN");
// Initialize
MethodsClient methods = Slack.getInstance().methods(token);
// Call the slackbot.skills.create method
SlackbotSkillsCreateRequest request = SlackbotSkillsCreateRequest.builder()
.displayName("Daily priorities")
.instructions("# Purpose\nSuggest the three most important things to work on today.")
.description("Reviews information from Slack and your calendar to suggest priorities for the day.")
.category("productivity")
.examplePrompt("Run {skill} for today")
.mcpServers(Arrays.asList(SkillMcpServer.builder()
.serviceType("app")
.appId("A0123ABCD")
.serverId("Amcp0456EFGH")
.build()))
.build();
SlackbotSkillsCreateResponse response = methods.slackbotSkillsCreate(request);
// Inspect the response
System.out.println(response);
}
}