Skip to main content
Glama
laktek
by laktek

reload_all_buffers

Reload all open buffers that have changed on disk after external file edits to maintain content synchronization in Neovim.

Instructions

Check all open buffers and reload any that have changed on disk. Use this after editing files externally.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The core handler function that connects to Neovim instances, executes 'checktime' to reload changed buffers from disk, collects listed buffer names, and returns a success message with count.
    export async function reloadAllBuffers() {
      const instances = await getNvimInstancesInCwd();
      const reloadedBuffers = [];
    
      for (const { nvim } of instances) {
        try {
          // Use checktime to reload all buffers that have changed on disk
          await nvim.command("checktime");
    
          const buffers = await nvim.buffers;
          for (const buf of buffers) {
            const listed = await nvim.call("buflisted", [buf.id]);
            if (listed) {
              const name = await buf.name;
              if (name) {
                reloadedBuffers.push(name);
              }
            }
          }
        } catch (error) {
          console.error("Error reloading buffers:", error.message);
        }
      }
    
      return {
        success: true,
        message: `Checked ${reloadedBuffers.length} buffer(s) for changes`,
        buffers: reloadedBuffers,
      };
    }
  • MCP tool schema defining the tool name, description, and input schema (no required parameters). Part of the tools list returned by ListToolsRequestHandler.
    {
      name: "reload_all_buffers",
      description:
        "Check all open buffers and reload any that have changed on disk. Use this after editing files externally.",
      inputSchema: {
        type: "object",
        properties: {},
      },
    },
  • index.js:286-296 (registration)
    Dispatch logic in CallToolRequestHandler that matches the tool name and calls the reloadAllBuffers handler function, returning the result message.
    if (name === "reload_all_buffers") {
      const result = await reloadAllBuffers();
      return {
        content: [
          {
            type: "text",
            text: result.message,
          },
        ],
      };
    }
  • index.js:12-19 (registration)
    Import of the reloadAllBuffers handler from lib/nvim-operations.js into the main server file.
      getCurrentBuffer,
      listOpenBuffers,
      getBufferContent,
      updateBuffer,
      reloadBuffer,
      reloadAllBuffers,
      openFile,
    } from "./lib/nvim-operations.js";
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It explains the tool checks for changes and reloads buffers, implying a read-and-write operation, but doesn't detail aspects like error handling, permissions needed, or side effects on unsaved changes. It adds basic context but lacks depth for a mutation tool.

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 highly concise and well-structured in two sentences: the first states the purpose, and the second provides usage guidance. Every sentence earns its place with no wasted words, making it easy for an agent to parse and apply efficiently.

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 has no parameters, no output schema, and no annotations, the description is adequate but minimal. It covers the basic purpose and usage, but for a tool that performs mutations (reloading buffers), more details on behavior, such as confirmation prompts or effects on buffer state, would enhance completeness for safe agent invocation.

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?

The input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description doesn't discuss parameters, which is appropriate here, and it adds value by explaining the tool's action and usage context, justifying a score above the baseline of 3 for such cases.

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's purpose with specific verbs ('check', 'reload') and resources ('all open buffers'), explaining it detects and reloads buffers changed on disk. However, it doesn't explicitly differentiate from its sibling 'reload_buffer', which likely handles individual buffers, leaving some ambiguity in sibling distinction.

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

Usage Guidelines5/5

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

The description provides explicit usage guidance by stating 'Use this after editing files externally,' which clearly indicates when to invoke the tool. This gives the agent a concrete scenario for application, though it doesn't mention alternatives or exclusions, the context is sufficiently clear for effective use.

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/laktek/nvim-mcp-server'

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