diff --git a/internal/server/server.go b/internal/server/server.go index a6c91d9e3a088241706a1281bb0efbd3b2141383..7dc2ca562462eecb7bf9082d759670faef05f294 100644 --- a/internal/server/server.go +++ b/internal/server/server.go @@ -40,10 +40,21 @@ func New(cfg *config.Config) *mcp.Server { }, &mcp.ServerOptions{}) // Register tools with the SB client closed over + mcp.AddTool(server, &mcp.Tool{ + Name: "usage", + Description: "Load the SilverBullet usage guide, gotchas, and best practices. Call this BEFORE execute_lua.", + Annotations: &mcp.ToolAnnotations{ + Title: "Usage Guide", + ReadOnlyHint: true, + IdempotentHint: true, + OpenWorldHint: new(false), + }, + }, makeUsageHandler()) + mcp.AddTool(server, &mcp.Tool{ Name: "execute_lua", Description: "Execute a Space Lua script on the SilverBullet instance. " + - "Always call `usage` first to load the Space Lua reference and API guide.", + "DO NOT call this without FIRST calling usage to understand how to interact with SilverBullet in the first place.", Annotations: &mcp.ToolAnnotations{ Title: "Execute Lua", ReadOnlyHint: false, @@ -75,18 +86,6 @@ func New(cfg *config.Config) *mcp.Server { }, }, makeConsoleLogsHandler(sbClient)) - mcp.AddTool(server, &mcp.Tool{ - Name: "usage", - Description: "Load the full SilverBullet usage guide: Space Lua syntax, available APIs (space.*, editor.*, net.*, query), gotchas, and best practices. " + - "Always call this before `execute_lua`.", - Annotations: &mcp.ToolAnnotations{ - Title: "Usage Guide", - ReadOnlyHint: true, - IdempotentHint: true, - OpenWorldHint: ptrBool(false), - }, - }, makeUsageHandler()) - return server }