Skip to main content
Glama
AbdurRaahimm

MCP Terminal & Git Server

by AbdurRaahimm

open_in_vscode

Open directories or files directly in VSCode from the MCP Terminal & Git Server to streamline development workflows.

Instructions

Open a directory or file in VSCode

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesPath to open in VSCode

Implementation Reference

  • The handler for the 'open_in_vscode' tool within the CallToolRequestSchema switch statement. It resolves the provided path and calls the openInVSCode helper function to open it in VSCode.
    case "open_in_vscode": {
      const { path: targetPath } = args as { path: string };
      const resolvedPath = resolvePath(targetPath);
      
      await openInVSCode(resolvedPath);
      
      return {
        content: [
          {
            type: "text",
            text: `Opened ${resolvedPath} in VSCode`,
          },
        ],
      };
    }
  • src/index.ts:197-210 (registration)
    Registration of the 'open_in_vscode' tool in the ListToolsRequestSchema response, including name, description, and input schema.
    {
      name: "open_in_vscode",
      description: "Open a directory or file in VSCode",
      inputSchema: {
        type: "object",
        properties: {
          path: {
            type: "string",
            description: "Path to open in VSCode",
          },
        },
        required: ["path"],
      },
    },
  • Shared helper function that implements the core logic to open a project path in VSCode, trying 'code' command first then fallback executable paths.
    // Helper function to open project in VSCode
    async function openInVSCode(projectPath: string): Promise<void> {
      try {
        await execa("code", [projectPath]);
      } catch (error) {
        // If 'code' command fails, try common VSCode executable paths
        const vscodePaths = [
          "code",
          "/usr/local/bin/code",
          "/usr/bin/code",
          "C:\\Program Files\\Microsoft VS Code\\Code.exe",
          "C:\\Program Files (x86)\\Microsoft VS Code\\Code.exe",
        ];
    
        for (const codePath of vscodePaths) {
          try {
            await execa(codePath, [projectPath]);
            return;
          } catch {
            // Continue to next path
          }
        }
        
        throw new Error("VSCode not found. Please ensure VSCode is installed and 'code' command is available in PATH");
      }
    }
Behavior2/5

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

With no annotations provided, the description carries full burden but only states the basic action without behavioral details. It doesn't disclose if this requires VSCode installation, what happens if the path doesn't exist, whether it opens in a new window or existing instance, or any error handling, which are critical for a tool that interacts with external applications.

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?

The description is a single, direct sentence with zero wasted words, making it highly concise and front-loaded. It efficiently communicates the core purpose without unnecessary elaboration, earning full marks for clarity and brevity.

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 complexity of opening files in an external editor and the lack of annotations and output schema, the description is insufficient. It doesn't cover behavioral aspects like prerequisites, error cases, or what success looks like, leaving significant gaps for the agent to operate this tool effectively in real-world scenarios.

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?

The input schema has 100% description coverage, clearly documenting the 'path' parameter. The description adds no additional semantic information beyond what the schema provides, such as path format examples or constraints, so it meets the baseline for high schema coverage without enhancing parameter understanding.

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 action ('Open') and target ('a directory or file in VSCode'), making the purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'check_directory' or 'execute_command', which might also involve file system operations, so it misses the highest clarity level.

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?

The description provides no guidance on when to use this tool versus alternatives. For example, it doesn't specify if this is for opening existing files vs. creating new ones, or how it differs from 'check_directory' or other sibling tools, leaving the agent to infer usage context.

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/AbdurRaahimm/mcp-git-terminal-server'

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