Skip to main content
Glama

present_workspace_choice

Displays a list of detected workspaces and prompts the user to select one for further operations.

Instructions

Present detected workspaces to user for selection

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function for the present_workspace_choice tool. It delegates to smartWorkspaceInit() which detects VS Code workspaces and presents them to the user for selection.
    async presentWorkspaceChoice(): Promise<ToolResult> {
      return this.smartWorkspaceInit();
    }
  • Tool definition/schema for present_workspace_choice. It takes no input parameters and is used to present detected VS Code workspaces to the user for selection.
    {
      name: 'present_workspace_choice',
      description: 'Present detected workspaces to user for selection',
      inputSchema: {
        type: 'object',
        properties: {},
      },
    },
  • src/index.ts:147-150 (registration)
    Registration of the 'present_workspace_choice' tool in the server's executeToolCommand switch statement. It first runs detectWorkspaces() then calls presentWorkspaceChoice() on the VSCodeDetectionService.
    case 'present_workspace_choice':
      // For now, just call the method without args since it doesn't need them
      const detectionResult = await this.vsCodeDetectionService.detectWorkspaces();
      return await this.vsCodeDetectionService.presentWorkspaceChoice();
  • Helper function called by presentWorkspaceChoice(). Performs full VS Code workspace detection and formats the results into a user-friendly selection prompt with numbered options.
      async smartWorkspaceInit(): Promise<ToolResult> {
        try {
          // First, try to detect workspaces
          const detection = await this._performDetection();
          
          if (detection.totalWorkspaces === 0) {
            return {
              content: [{
                type: 'text',
                text: `🔍 **No VS Code workspaces detected**
    
    I couldn't find any open VS Code windows or recent workspaces. Here are your options:
    
    1. Open VS Code with a project folder, then ask me to detect workspaces again
    2. **Tell me the path** to your project (e.g., "/Users/yourname/projects/myproject")
    3. **Create a new project** - just tell me what type of project you want to create
    
    What would you like to do?`,
              }],
            };
          }
    
          // Format workspaces for user selection
          let response = `🎯 **VS Code Workspace Detection**\n\nI found the following workspaces:\n\n`;
          
          // Show currently open workspaces first
          if (detection.instances.length > 0) {
            response += `**🟢 Currently Open in VS Code:**\n`;
            let index = 1;
            for (const instance of detection.instances) {
              for (const workspace of instance.workspaces) {
                response += `${index}. ${workspace.name}\n   📁 ${workspace.path}\n`;
                index++;
              }
            }
            response += '\n';
          }
    
          // Show recent workspaces
          if (detection.recentWorkspaces.length > 0) {
            response += `**📂 Recent Workspaces:**\n`;
            let index = detection.instances.flatMap(i => i.workspaces).length + 1;
            const recentToShow = detection.recentWorkspaces.slice(0, 5);
            for (const workspace of recentToShow) {
              response += `${index}. ${workspace.name}\n   📁 ${workspace.path}\n`;
              if (workspace.lastAccessed) {
                response += `   🕒 Last used: ${this._formatDate(workspace.lastAccessed)}\n`;
              }
              index++;
            }
          }
    
          response += `\n**To select a workspace:**
    • Tell me the number (e.g., "use workspace 1")
    • Or tell me to use the first/most recent one
    • Or provide a different path
    
    Which workspace would you like to use?`;
    
          return {
            content: [{
              type: 'text',
              text: response,
            }],
          };
        } catch (error) {
          return {
            isError: true,
            content: [{
              type: 'text',
              text: `Failed to detect workspaces: ${error instanceof Error ? error.message : 'Unknown error'}`,
            }],
          };
        }
      }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, and the description only states the action without disclosing behavioral traits like blocking, user interaction details, or side effects.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single sentence, no unnecessary words. Perfectly concise for the simple action described.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Adequate for a parameterless tool without output schema, but could explain what 'detected workspaces' means and how the selection is returned or used.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

No parameters exist, so schema coverage is 100%. The description does not need to add parameter details, and it correctly implies a straightforward inputless invocation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool presents detected workspaces for user selection. It distinguishes from sibling tools like 'detect_vscode_workspaces' and 'auto_select_workspace', but does not explicitly differentiate.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives such as 'auto_select_workspace' or 'list_workspaces'. The description lacks context for appropriate usage.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/agentics-ai/code-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server