Skip to main content
Glama

connect

Establish a persistent session with a running Neovim instance over Unix socket or TCP. Call this before any other tool, with options for auto-connect or explicit selection via index, socket path, or terminal PID.

Instructions

Connect to a running Neovim instance over its Unix socket or TCP address.

Call this before any other tool if the agent is not yet connected. Connection is persistent for the session; you only need to call it once unless you want to switch instances.

Called with no arguments: auto-connects when exactly one instance is running; returns a list of instances when multiple are found.

Optional selection (provide at most one):

  • index: pick from the listed instances (1-based).

  • socket_path: connect directly to a known Unix socket or host:port.

  • terminal_pid: find the Neovim instance whose process tree contains this PID (useful when Neovim runs inside a specific terminal).

Returns {connected, cwd, file} on success, or {error} with details on failure (e.g. no instances found, connection timeout, bad index).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
socket_pathNo
terminal_pidNo
indexNo
Behavior5/5

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

No annotations exist, but the description fully discloses behavior: persistent connection, auto-connect behavior, effects of each optional parameter, and return format (success with connected/cwd/file or error with details). No hidden behaviors.

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?

Every sentence serves a purpose: core action, when to use, auto-connect vs. manual, parameter explanations, return values. Well-structured and efficient with no redundancy.

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

Completeness4/5

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

Covers the tool's operation well given no annotations, explaining arguments, return values, and usage flow. Minor omission: no mention of disconnection or error recovery, but these are likely out of scope for a single-use connection tool.

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

Parameters5/5

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

Schema has 0% coverage, but description explains each parameter's meaning and constraints: index is 1-based, socket_path is a socket or host:port, terminal_pid finds by PID in process tree. It also notes 'provide at most one', adding crucial usage logic.

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 it connects to a Neovim instance over Unix socket or TCP. The verb 'connect' and resource 'Neovim instance' are specific. It distinguishes itself from sibling tools like 'send_keys' or 'read_buf_range' which are for different purposes.

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

Usage Guidelines4/5

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

The description explicitly says to call this before any other tool if not connected, and explains auto-connect vs. manual selection. While it doesn't mention alternatives, there are no other connection tools, so guidance is clear and useful.

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

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