Skip to main content
Glama

highlight_ranges

Highlight multiple line ranges across Neovim buffers simultaneously using colored annotations without altering buffer content. Provide file path, start and end lines, and optional hex color.

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
Behavior5/5

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

No annotations provided, but the description comprehensively covers behavioral traits: visual annotation only, no persistence, stacking behavior, error handling (missing keys), and clamping of out-of-range lines. No contradictions.

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?

While lengthy, every sentence adds value. Well-structured with separate sections for purpose, behavior, parameter details, usage guidance, return info, and example. Appropriate length given complexity of input.

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 no annotations, the description covers all essential aspects: purpose, behavior, parameter semantics, usage guidelines, error conditions, and return values. It even mentions output schema structure. Fully complete for a complex 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 coverage is 0% with a generic array-of-objects definition. Description fully compensates by detailing required fields (file, start_line, end_line), optional color with default, clamping, and return structure. Includes an example. Adds substantial meaning beyond 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?

Description clearly states the action (add colored line highlights), resource (Neovim buffers), and scope (one or more buffers in a single call). It distinguishes from sibling tools like highlight_range (single range) and clear_highlights (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?

Explicitly tells when to use this tool (multiple ranges at once across files) and when to use alternatives (highlight_range for single, clear_highlights for removal). Provides clear usage context.

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