@@ -47,9 +47,9 @@ func New(cfg *config.Config) *mcp.Server {
Annotations: &mcp.ToolAnnotations{
Title: "Execute Lua",
ReadOnlyHint: false,
- DestructiveHint: ptrBool(true),
+ DestructiveHint: new(true),
IdempotentHint: false,
- OpenWorldHint: ptrBool(true),
+ OpenWorldHint: new(true),
},
}, makeExecuteLuaHandler(sbClient, defaultTimeout))
@@ -60,7 +60,7 @@ func New(cfg *config.Config) *mcp.Server {
Title: "Screenshot",
ReadOnlyHint: true,
IdempotentHint: false,
- OpenWorldHint: ptrBool(false),
+ OpenWorldHint: new(false),
},
}, makeScreenshotHandler(sbClient))
@@ -71,7 +71,7 @@ func New(cfg *config.Config) *mcp.Server {
Title: "Console Logs",
ReadOnlyHint: true,
IdempotentHint: false,
- OpenWorldHint: ptrBool(false),
+ OpenWorldHint: new(false),
},
}, makeConsoleLogsHandler(sbClient))
@@ -114,11 +114,6 @@ func Run(ctx context.Context, cfg *config.Config) error {
return server.Run(ctx, t)
}
-// ptrBool returns a pointer to the given bool value.
-func ptrBool(b bool) *bool {
- return &b
-}
-
// makeExecuteLuaHandler returns a tool handler that closes over the SB client.
func makeExecuteLuaHandler(client *silverbullet.Client, defaultTimeout int) func(context.Context, *mcp.CallToolRequest, ExecuteLuaParams) (*mcp.CallToolResult, any, error) {
return func(ctx context.Context, req *mcp.CallToolRequest, params ExecuteLuaParams) (*mcp.CallToolResult, any, error) {