Skip to content

Commit 91708e3

Browse files
authored
Merge pull request #144 from triepod-ai/feat/add-tool-annotations
feat: Add tool annotations for improved LLM tool understanding
2 parents 454398a + 3ae68d4 commit 91708e3

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

pkg/server/server.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ func NewMCPServer(provider *provider.ApiProvider, logger *zap.Logger) *MCPServer
3535

3636
s.AddTool(mcp.NewTool("conversations_history",
3737
mcp.WithDescription("Get messages from the channel (or DM) by channel_id, the last row/column in the response is used as 'cursor' parameter for pagination if not empty"),
38+
mcp.WithTitleAnnotation("Get Conversation History"),
39+
mcp.WithReadOnlyHintAnnotation(true),
3840
mcp.WithString("channel_id",
3941
mcp.Required(),
4042
mcp.Description(" - `channel_id` (string): ID of the channel in format Cxxxxxxxxxx or its name starting with #... or @... aka #general or @username_dm."),
@@ -54,6 +56,8 @@ func NewMCPServer(provider *provider.ApiProvider, logger *zap.Logger) *MCPServer
5456

5557
s.AddTool(mcp.NewTool("conversations_replies",
5658
mcp.WithDescription("Get a thread of messages posted to a conversation by channelID and thread_ts, the last row/column in the response is used as 'cursor' parameter for pagination if not empty"),
59+
mcp.WithTitleAnnotation("Get Thread Replies"),
60+
mcp.WithReadOnlyHintAnnotation(true),
5761
mcp.WithString("channel_id",
5862
mcp.Required(),
5963
mcp.Description("ID of the channel in format Cxxxxxxxxxx or its name starting with #... or @... aka #general or @username_dm."),
@@ -77,6 +81,8 @@ func NewMCPServer(provider *provider.ApiProvider, logger *zap.Logger) *MCPServer
7781

7882
s.AddTool(mcp.NewTool("conversations_add_message",
7983
mcp.WithDescription("Add a message to a public channel, private channel, or direct message (DM, or IM) conversation by channel_id and thread_ts."),
84+
mcp.WithTitleAnnotation("Send Message"),
85+
mcp.WithDestructiveHintAnnotation(true),
8086
mcp.WithString("channel_id",
8187
mcp.Required(),
8288
mcp.Description("ID of the channel in format Cxxxxxxxxxx or its name starting with #... or @... aka #general or @username_dm."),
@@ -95,6 +101,8 @@ func NewMCPServer(provider *provider.ApiProvider, logger *zap.Logger) *MCPServer
95101

96102
conversationsSearchTool := mcp.NewTool("conversations_search_messages",
97103
mcp.WithDescription("Search messages in a public channel, private channel, or direct message (DM, or IM) conversation using filters. All filters are optional, if not provided then search_query is required."),
104+
mcp.WithTitleAnnotation("Search Messages"),
105+
mcp.WithReadOnlyHintAnnotation(true),
98106
mcp.WithString("search_query",
99107
mcp.Description("Search query to filter messages. Example: 'marketing report' or full URL of Slack message e.g. 'https://slack.com/archives/C1234567890/p1234567890123456', then the tool will return a single message matching given URL, herewith all other parameters will be ignored."),
100108
),
@@ -143,6 +151,8 @@ func NewMCPServer(provider *provider.ApiProvider, logger *zap.Logger) *MCPServer
143151

144152
s.AddTool(mcp.NewTool("channels_list",
145153
mcp.WithDescription("Get list of channels"),
154+
mcp.WithTitleAnnotation("List Channels"),
155+
mcp.WithReadOnlyHintAnnotation(true),
146156
mcp.WithString("channel_types",
147157
mcp.Required(),
148158
mcp.Description("Comma-separated channel types. Allowed values: 'mpim', 'im', 'public_channel', 'private_channel'. Example: 'public_channel,private_channel,im'"),

0 commit comments

Comments
 (0)