Skip to content

Commit 9595774

Browse files
committed
Add tool capabilities to MCPServer structure
Signed-off-by: edmondfrank <[email protected]>
1 parent 78f35a5 commit 9595774

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

server/server.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ func (s *MCPServer) SendNotificationToClient(
138138

139139
// serverCapabilities defines the supported features of the MCP server
140140
type serverCapabilities struct {
141+
tools *toolCapabilities
141142
resources *resourceCapabilities
142143
prompts *promptCapabilities
143144
logging bool
@@ -154,6 +155,11 @@ type promptCapabilities struct {
154155
listChanged bool
155156
}
156157

158+
// toolCapabilities defines the supported tool-related features
159+
type toolCapabilities struct {
160+
listChanged bool
161+
}
162+
157163
// WithResourceCapabilities configures resource-related server capabilities
158164
func WithResourceCapabilities(subscribe, listChanged bool) ServerOption {
159165
return func(s *MCPServer) {
@@ -173,6 +179,15 @@ func WithPromptCapabilities(listChanged bool) ServerOption {
173179
}
174180
}
175181

182+
// WithToolCapabilities configures tool-related server capabilities
183+
func WithToolCapabilities(listChanged bool) ServerOption {
184+
return func(s *MCPServer) {
185+
s.capabilities.tools = &toolCapabilities{
186+
listChanged: listChanged,
187+
}
188+
}
189+
}
190+
176191
// WithLogging enables logging capabilities for the server
177192
func WithLogging() ServerOption {
178193
return func(s *MCPServer) {

0 commit comments

Comments
 (0)