Skip to content

Make workspace selection discoverable to MCP clients#17

Open
kevingil wants to merge 1 commit into
render-oss:mainfrom
kevingil:improve-workspace-selection-discoverability
Open

Make workspace selection discoverable to MCP clients#17
kevingil wants to merge 1 commit into
render-oss:mainfrom
kevingil:improve-workspace-selection-discoverability

Conversation

@kevingil

Copy link
Copy Markdown

When a tool returned ErrNoWorkspace, the message told the model to "prompt the user" but never named list_workspaces / select_workspace, so models that hit the error often concluded no such tool existed and stalled.

Two changes:

  1. Rewrite ErrNoWorkspace to spell out the recovery path (list_workspaces -> ask user -> select_workspace -> retry) and explain why the model must not auto-select.

  2. Pass server.WithInstructions on the MCP server so the workspace flow is in the host's system context from session start, before any workspace-gated tool is attempted.

When a tool returned ErrNoWorkspace, the message told the model to "prompt
the user" but never named list_workspaces / select_workspace, so models
that hit the error often concluded no such tool existed and stalled.

Two changes:

  1. Rewrite ErrNoWorkspace to spell out the recovery path
     (list_workspaces -> ask user -> select_workspace -> retry) and
     explain why the model must not auto-select.

  2. Pass server.WithInstructions on the MCP server so the workspace
     flow is in the host's system context from session start, before
     any workspace-gated tool is attempted.
@kevingil

Copy link
Copy Markdown
Author

Relates to issue #16

@kevingil

kevingil commented May 10, 2026

Copy link
Copy Markdown
Author

Not sure if the new serverInstructions is too much. Updated ErrNoWorkspace might be all we need.

@michaelmelanson michaelmelanson left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @kevingil, thanks for your pull request!

As you called out, it seems like the server instructions aren't needed. Other than that the changes look great, so once you've removed them I'd be happy to merge.

Comment thread cmd/server.go

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right that these server instructions don't seem to be needed. I tested it out without them, and it works fine. Would you mind removing these instructions to keep it minimal?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants