File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -689,6 +689,11 @@ func getAgentToken(fs afero.Fs) (string, error) {
689
689
// mcpFromSDK adapts a toolsdk.Tool to go-mcp's server.ServerTool.
690
690
// It assumes that the tool responds with a valid JSON object.
691
691
func mcpFromSDK (sdkTool toolsdk.Tool [any ]) server.ServerTool {
692
+ // NOTE: some clients will silently refuse to use tools if there is an issue
693
+ // with the tool's schema or configuration.
694
+ if sdkTool .Schema .Properties == nil {
695
+ panic ("developer error: schema properties cannot be nil" )
696
+ }
692
697
return server.ServerTool {
693
698
Tool : mcp.Tool {
694
699
Name : sdkTool .Tool .Name ,
Original file line number Diff line number Diff line change @@ -259,6 +259,10 @@ is provisioned correctly and the agent can connect to the control plane.
259
259
Tool : aisdk.Tool {
260
260
Name : "coder_list_templates" ,
261
261
Description : "Lists templates for the authenticated user." ,
262
+ Schema : aisdk.Schema {
263
+ Properties : map [string ]any {},
264
+ Required : []string {},
265
+ },
262
266
},
263
267
Handler : func (ctx context.Context , _ map [string ]any ) ([]MinimalTemplate , error ) {
264
268
client , err := clientFromContext (ctx )
@@ -318,6 +322,10 @@ is provisioned correctly and the agent can connect to the control plane.
318
322
Tool : aisdk.Tool {
319
323
Name : "coder_get_authenticated_user" ,
320
324
Description : "Get the currently authenticated user, similar to the `whoami` command." ,
325
+ Schema : aisdk.Schema {
326
+ Properties : map [string ]any {},
327
+ Required : []string {},
328
+ },
321
329
},
322
330
Handler : func (ctx context.Context , _ map [string ]any ) (codersdk.User , error ) {
323
331
client , err := clientFromContext (ctx )
You can’t perform that action at this time.
0 commit comments