Skip to main content
Glama

highlight_ranges

Add colored line highlights to one or more Neovim buffers simultaneously. Specify file, start and end line, and optional color for each range.

Instructions

Add colored line highlights to one or more Neovim buffers in a single call. This is a visual annotation only — it does not modify buffer content and is not persisted to disk. Highlights stack; calling this adds more highlights without removing previous ones.

highlights: a list of dicts. Each dict requires:

  • file: path relative to Neovim's cwd (as shown in get_state). The buffer must be open in Neovim.

  • start_line: first line (1-indexed, inclusive).

  • end_line: last line (1-indexed, inclusive).

  • color (optional): hex color or Neovim color name. Defaults to "#3b4048". Out-of-range lines are clamped.

Use this when you need to highlight several ranges at once (possibly across different files). Use highlight_range for a single range. Use clear_highlights to remove all highlights from a buffer.

Returns a list of {highlighted} results in the same order as the input. Raises an error if any item is missing required keys.

Example: [{"file": "foo.py", "start_line": 1, "end_line": 3, "color": "#5f3a3a"}, {"file": "foo.py", "start_line": 10, "end_line": 12}]

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
highlightsYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

With no annotations, the description covers key behaviors: non-persistent, stacking, line clamping, and error handling for missing keys. Could mention performance implications or auth requirements, but these are less relevant for a visual annotation tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is thorough and well-organized, starting with purpose, then parameter details, usage guidance, return value, and an example. Slightly verbose but every sentence adds value.

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 complexity of the single parameter and the presence of an output schema, the description covers return value format, error conditions, and provides an example, making it fully sufficient.

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?

The schema has 0% coverage with a generic array of objects, but the description fully defines each required key (file, start_line, end_line) and optional color, including details like relative paths, 1-indexing, and clamping.

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 adds colored line highlights to one or more Neovim buffers, emphasizing it is a visual annotation only with no persistence. It distinguishes from siblings like highlight_range and clear_highlights.

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?

Explicitly mentions when to use this tool (multiple ranges across files) and provides alternatives: highlight_range for a single range, clear_highlights to remove. Also notes that buffers must be open.

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