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
| Name | Required | Description | Default |
|---|---|---|---|
| items | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |