Skip to main content
Glama

add_virtual_texts

Add multiple virtual text annotations to Neovim buffers in a single call. Specify file, line, text, and optional position and color for each annotation.

Instructions

Add multiple virtual text annotations to Neovim buffers in a single call. Visual only — buffer content is unchanged. Annotations stack; calling this adds more without removing previous ones.

items: a list of dicts. Each dict requires:

  • file: path relative to Neovim's cwd. Buffer must be open.

  • line: 1-indexed anchor line. Out-of-range values are clamped.

  • text: list of strings, one per virtual line. Non-empty. EOL position requires exactly one item. And optionally:

  • position: "eol" (default), "above", or "below".

  • color: hex color (e.g. "#7a9ad4") or Neovim highlight group name (e.g. "Comment", "DiagnosticError"). Defaults to "Comment". Unknown names (including bare color literals like "Red") return an error.

Use this when you need to add several annotations at once (possibly across different files). Use add_virtual_text for a single annotation. Use clear_virtual_texts to remove all MCP virtual text from a buffer.

Returns a list of {added: 1} results in input order. Raises a ValueError if any item is missing a required key. Iteration is sequential: if item N fails validation or the manager raises, items 0..N-1 have already been applied (call clear_virtual_texts to roll back).

Example: [{"file": "foo.py", "line": 10, "text": ["this is the bug"]}, {"file": "foo.py", "line": 20, "text": ["note one", "note two"], "position": "above", "color": "DiagnosticInfo"}]

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
itemsYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

Despite no annotations, the description thoroughly discloses behavioral traits: visual only, stacking behavior, clamping of out-of-range lines, position options, color behavior (including error on unknown names), and the critical fact that partial application occurs on failure with rollback via clear_virtual_texts.

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 well-organized: purpose first, then structured parameter breakdown, then usage guidance and example. Every sentence adds value; no redundancy or fluff.

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

Completeness5/5

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

Given the tool's complexity (multiple items, nested fields, side effects), the description covers input format, constraints, error handling, return format, and partial application behavior. It is complete and leaves no ambiguity.

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?

With 0% schema description coverage, the description fully compensates by detailing each field in the items list, including required vs optional, types, defaults, and a concrete example. This adds significant meaning beyond the minimal schema.

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 adds multiple virtual text annotations to Neovim buffers in a single call, and explicitly distinguishes it from sibling tools (add_virtual_text for single, clear_virtual_texts for removal).

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?

Provides explicit guidance on when to use this tool ('when you need to add several annotations at once') and when to use alternatives, including direct references to sibling tools.

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