Skip to main content
Glama

highlight_ranges

Highlight multiple line ranges across open Neovim buffers in a single call. Visual annotations stack without altering file content.

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 (e.g. "#5f3a3a") or Neovim highlight group name (e.g. "Comment", "DiagnosticError"). For groups, the resolved foreground color becomes the line background. Defaults to "Comment". Unknown names (including bare color literals like "Red") return an error. 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": "DiagnosticError"}, {"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, so description carries full burden. It discloses: visual annotation only, no modification or persistence, stacking behavior, error handling for unknown colors and missing keys, and clamping of out-of-range lines. Also mentions return format and error conditions.

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?

Well-structured with separate sections for purpose, parameter details, usage guidance, return info, and example. Not overly long, but the parameter details could be slightly more concise (e.g., bullet points). Still highly efficient.

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 complexity (nested objects with 4 keys) and presence of output schema, description covers all needed: purpose, parameter semantics, usage guidelines, behavioral traits, error handling, and example. Complete for correct tool invocation.

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%, but description fully documents the 'highlights' parameter: structure of each dict (file, start_line, end_line, optional color with default and error behaviors), and includes an example. Adds 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 it adds colored line highlights to one or more Neovim buffers in a single call. It distinguishes from sibling tools 'highlight_range' (single range) and 'clear_highlights' (removing). The verb and resource are specific.

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?

Explicit guidance: 'Use this when you need to highlight several ranges at once (possibly across different files).' Also provides alternatives: 'Use highlight_range for a single range. Use clear_highlights to remove all highlights.' Clear when to use and when not.

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