Skip to content

Commit 3bf779d

Browse files
zimegClaude
andauthored
feat: add slackbot.skills.update method example (#371)
Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
1 parent 4251bd3 commit 3bf779d

2 files changed

Lines changed: 30 additions & 0 deletions

File tree

‎methods/README.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,4 @@ $ slack run chat_post_message.py # Make the request
5151

5252
- **[slackbot.skills.create](https://docs.slack.dev/reference/methods/slackbot.skills.create)**: Creates a skill from markdown instructions, or turns an existing canvas the caller owns into a skill. [Implementation](./src/slackbot/skills/slackbot_skills_create.py).
5353
- **[slackbot.skills.info](https://docs.slack.dev/reference/methods/slackbot.skills.info)**: Returns one Slackbot skill, including its instructions. [Implementation](./src/slackbot/skills/slackbot_skills_info.py).
54+
- **[slackbot.skills.update](https://docs.slack.dev/reference/methods/slackbot.skills.update)**: Changes a Slackbot skill's instructions or metadata. Only the inputs you send are changed; a call that changes nothing succeeds without writing. [Implementation](./src/slackbot/skills/slackbot_skills_update.py).
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import os
2+
3+
from slack_sdk import WebClient
4+
5+
# Read a token from an environment variable
6+
token = os.environ.get("SLACK_TOKEN")
7+
8+
# Initialize
9+
client = WebClient(token=token)
10+
11+
# Call the slackbot.skills.update method
12+
response = client.slackbot_skills_update(
13+
skill_id="F0123ABCD",
14+
display_name="Daily priorities",
15+
instructions="# Purpose\nSuggest the three most important things to work on today.",
16+
description="Reviews information from Slack and your calendar to suggest priorities for the day.",
17+
category="productivity",
18+
example_prompt="Run {skill} for today",
19+
mcp_servers=[
20+
{
21+
"service_type": "app",
22+
"app_id": "A0123ABCD",
23+
"server_id": "Amcp0456EFGH",
24+
},
25+
],
26+
)
27+
28+
# Inspect the response
29+
print(response)

0 commit comments

Comments
 (0)