Skip to main content
Glama

auto_select_workspace

Automatically determines and activates the most suitable VS Code workspace based on current context, eliminating manual selection.

Instructions

Automatically select the most appropriate VS Code workspace

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function that executes the auto_select_workspace logic. It detects VS Code workspaces, selects the most appropriate one (priority: currently open workspace > most recent workspace), and returns the result.
    async autoSelectWorkspace(): Promise<ToolResult> {
      try {
        const detection = await this._performDetection();
        
        // Priority: Currently open workspace > Most recent workspace
        let selectedWorkspace: VSCodeWorkspace | null = null;
        
        if (detection.instances.length > 0 && detection.instances[0].workspaces.length > 0) {
          selectedWorkspace = detection.instances[0].workspaces[0];
        } else if (detection.recentWorkspaces.length > 0) {
          selectedWorkspace = detection.recentWorkspaces[0];
        }
    
        if (!selectedWorkspace) {
          return {
            content: [{
              type: 'text',
              text: 'No VS Code workspaces found. Please open VS Code with a workspace or manually set a workspace path.',
            }],
          };
        }
    
        return {
          content: [{
            type: 'text',
            text: `šŸŽÆ **Auto-selected workspace:** ${selectedWorkspace.name}\nšŸ“ **Path:** ${selectedWorkspace.path}\n🟢 **Status:** ${selectedWorkspace.isOpen ? 'Currently Open' : 'Recent'}\n\nI'll use this workspace for our session. You can change it anytime by asking me to switch workspaces.`,
          }],
        };
      } catch (error) {
        return {
          isError: true,
          content: [{
            type: 'text',
            text: `Failed to auto-select workspace: ${error instanceof Error ? error.message : 'Unknown error'}`,
          }],
        };
      }
    }
  • Schema definition for auto_select_workspace tool - it expects no input properties.
    {
      name: 'auto_select_workspace',
      description: 'Automatically select the most appropriate VS Code workspace',
      inputSchema: {
        type: 'object',
        properties: {},
      },
    },
  • src/index.ts:150-152 (registration)
    Registration of auto_select_workspace in the main tool dispatcher (switch-case), routing to vsCodeDetectionService.autoSelectWorkspace()
      return await this.vsCodeDetectionService.presentWorkspaceChoice();
    case 'auto_select_workspace':
      return await this.vsCodeDetectionService.autoSelectWorkspace();
Behavior2/5

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

No annotations are present, so the description must disclose behavior. It states 'automatically select' but does not explain the selection criteria (e.g., based on current files, history, or heuristics), nor does it clarify whether the tool changes the current workspace or merely suggests one. The lack of detail leaves the agent uncertain about side effects or output format.

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

Conciseness4/5

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

The description is concise at one sentence with no redundant words. However, it could be restructured to include a brief note on selection logic or output without significantly increasing length.

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

Completeness2/5

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

Given the tool has no parameters, no output schema, and no annotations, the description should provide enough context for correct invocation. It fails to describe the selection mechanism, the effect on the environment, or how the result is returned. This is insufficient for reliable use among sibling workspace tools.

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

Parameters3/5

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

There are no parameters, and schema coverage is 100%. According to guidelines, baseline is 4 for zero parameters. However, the description adds minimal value beyond the schema; it does not explain what the tool returns or any implicit input. Thus a score of 3 reflects adequate but not enhanced semantics.

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 selects a VS Code workspace automatically. However, it lacks specificity on what 'most appropriate' means and does not fully distinguish from sibling tools like detect_vscode_workspaces or set_workspace. The verb 'select' and resource 'workspace' are clear.

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 is provided on when to use this tool vs alternatives such as list_workspaces or set_workspace. The description does not mention prerequisites, typical scenarios, or when automatic selection is preferred over manual choice.

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