Skip to main content
Glama

vim_window

Split, close, and navigate Neovim windows using commands like split, vsplit, only, close, and wincmd with h/j/k/l for efficient window management.

Instructions

Manage Neovim windows: split, close, and navigate between windows

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
commandYesWindow manipulation command: split or vsplit to create new window, only to keep just current window, close to close current window, or wincmd with h/j/k/l to navigate between windows

Implementation Reference

  • Core handler function that validates the command and executes it directly on the Neovim instance using nvim.command().
    public async manipulateWindow(command: string): Promise<string> {
      const validCommands = ['split', 'vsplit', 'only', 'close', 'wincmd h', 'wincmd j', 'wincmd k', 'wincmd l'];
      if (!validCommands.some(cmd => command.startsWith(cmd))) {
        return 'Invalid window command';
      }
    
      try {
        const nvim = await this.connect();
        await nvim.command(command);
        return 'Window command executed';
      } catch (error) {
        console.error('Error manipulating window:', error);
        return 'Error executing window command';
      }
    }
  • src/index.ts:188-213 (registration)
    MCP server registration of the 'vim_window' tool, including description, input schema, and wrapper handler that calls the core implementation.
    server.tool(
      "vim_window",
      "Manage Neovim windows: split, close, and navigate between windows",
      { 
        command: z.enum(["split", "vsplit", "only", "close", "wincmd h", "wincmd j", "wincmd k", "wincmd l"])
          .describe("Window manipulation command: split or vsplit to create new window, only to keep just current window, close to close current window, or wincmd with h/j/k/l to navigate between windows")
      },
      async ({ command }) => {
        try {
          const result = await neovimManager.manipulateWindow(command);
          return {
            content: [{
              type: "text",
              text: result
            }]
          };
        } catch (error) {
          return {
            content: [{
              type: "text",
              text: error instanceof Error ? error.message : 'Error manipulating window'
            }]
          };
        }
      }
    );
  • Zod input schema defining the allowed 'command' enum values for the vim_window tool.
    { 
      command: z.enum(["split", "vsplit", "only", "close", "wincmd h", "wincmd j", "wincmd k", "wincmd l"])
        .describe("Window manipulation command: split or vsplit to create new window, only to keep just current window, close to close current window, or wincmd with h/j/k/l to navigate between windows")
    },
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. While 'manage' implies mutation capabilities, it doesn't specify permissions needed, side effects (e.g., whether closing a window destroys content), error conditions, or response format. For a mutation tool with zero annotation coverage, this is a significant gap.

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 extremely concise and front-loaded in a single sentence that efficiently communicates the core functionality. Every word earns its place with no redundancy or unnecessary elaboration, making it easy to parse quickly.

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?

Given the tool's moderate complexity (managing windows with multiple commands), no annotations, and no output schema, the description is minimally adequate but incomplete. It covers the basic purpose but lacks behavioral details, error handling, or output expectations that would be helpful for an AI agent.

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?

Schema description coverage is 100%, with the single parameter 'command' fully documented in the schema including enum values and descriptions. The description adds no additional parameter semantics beyond what's in the schema, so the baseline score of 3 is appropriate when the schema does the heavy lifting.

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

Purpose5/5

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

The description clearly states the tool's purpose with specific verbs ('split, close, and navigate') and resource ('Neovim windows'), distinguishing it from siblings like vim_buffer or vim_tab which handle different Neovim components. It precisely communicates what the tool does without being vague or tautological.

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. It doesn't mention prerequisites, when not to use it, or how it relates to sibling tools like vim_tab for tab management or vim_buffer for buffer operations. Usage is implied but not explicitly stated.

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

Related 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/bigcodegen/mcp-neovim-server'

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