Skip to main content
Glama

vim_mark

Set named marks at specific line and column positions in a text buffer using a single lowercase letter for identification, enabling precise navigation and editing.

Instructions

Set named marks at specific positions in the buffer

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
columnYesThe column number where the mark should be placed (0-indexed)
lineYesThe line number where the mark should be placed (1-indexed)
markYesSingle lowercase letter [a-z] to use as the mark name

Implementation Reference

  • The MCP tool handler function for 'vim_mark' that calls NeovimManager.setMark and returns standardized content response or error message.
    async ({ mark, line, column }) => {
      try {
        const result = await neovimManager.setMark(mark, line, column);
        return {
          content: [{
            type: "text",
            text: result
          }]
        };
      } catch (error) {
        return {
          content: [{
            type: "text",
            text: error instanceof Error ? error.message : 'Error setting mark'
          }]
        };
      }
    }
  • Zod schema defining input parameters for the vim_mark tool: mark (lowercase letter), line and column numbers.
    {
      mark: z.string().regex(/^[a-z]$/).describe("Single lowercase letter [a-z] to use as the mark name"),
      line: z.number().describe("The line number where the mark should be placed (1-indexed)"),
      column: z.number().describe("The column number where the mark should be placed (0-indexed)")
    },
  • src/index.ts:215-241 (registration)
    Registration of the 'vim_mark' tool on the MCP server, including name, description, input schema, and handler.
    server.tool(
      "vim_mark",
      "Set named marks at specific positions in the buffer",
      {
        mark: z.string().regex(/^[a-z]$/).describe("Single lowercase letter [a-z] to use as the mark name"),
        line: z.number().describe("The line number where the mark should be placed (1-indexed)"),
        column: z.number().describe("The column number where the mark should be placed (0-indexed)")
      },
      async ({ mark, line, column }) => {
        try {
          const result = await neovimManager.setMark(mark, line, column);
          return {
            content: [{
              type: "text",
              text: result
            }]
          };
        } catch (error) {
          return {
            content: [{
              type: "text",
              text: error instanceof Error ? error.message : 'Error setting mark'
            }]
          };
        }
      }
    );
  • Supporting method in NeovimManager that validates the mark name and executes the Vim 'mark' command followed by cursor positioning to the specified location.
    public async setMark(mark: string, line: number, col: number): Promise<string> {
      if (!/^[a-z]$/.test(mark)) {
        return 'Invalid mark name (must be a-z)';
      }
    
      try {
        const nvim = await this.connect();
        await nvim.command(`mark ${mark}`);
        const window = await nvim.window;
        await (window.cursor = [line, col]);
        return `Mark ${mark} set at line ${line}, column ${col}`;
      } catch (error) {
        console.error('Error setting mark:', error);
        return 'Error setting mark';
      }
    }
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. While 'Set' implies a mutation operation, it doesn't disclose whether this action is reversible, if it requires specific buffer states, what happens if a mark already exists, or any error conditions. For a mutation tool with zero annotation coverage, this is a significant gap in behavioral context.

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, efficient sentence that directly states the tool's purpose without any wasted words. It's appropriately sized and front-loaded with the core action.

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 (a mutation operation with 3 parameters) and no annotations or output schema, the description is minimally adequate. It states what the tool does but lacks crucial context about behavior, usage scenarios, and error handling that would be needed for an AI agent to use it effectively.

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 clear descriptions for all three parameters (mark, line, column). The description adds no additional parameter semantics beyond what the schema provides, such as explaining the relationship between parameters or typical usage patterns. Baseline 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.

Purpose4/5

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

The description clearly states the action ('Set named marks') and the target ('at specific positions in the buffer'), which is a specific verb+resource combination. However, it doesn't explicitly distinguish this tool from potential sibling tools like 'vim_jump' or 'vim_visual' that might also involve buffer navigation or marking.

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. There are no mentions of prerequisites, typical use cases, or comparisons with sibling tools like 'vim_jump' (which might involve jumping to marks) or 'vim_visual' (which might involve visual selections).

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