Skip to main content
Glama

LSP go to definition

nvim_lsp_definition

Resolve the definition location(s) of the symbol at a position. Returns file, line and column (1-based) for each location.

Instructions

Resolve the definition location(s) of the symbol at a position. Returns file, line and column (1-based) for each location.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
colNo1-based column number. Default 1.
lineNo1-based line number. Default 1.
pathNoTarget buffer by file path (must already be open). Ignored if bufnr is set.
bufnrNoTarget buffer number. Omit to use the path or the current buffer.
Behavior3/5

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

With no annotations, the description carries the burden of disclosing behavioral traits. It does mention the return format (file, line, column with 1-based indexing), but it does not mention prerequisites such as an active LSP server, failure behavior, or that the operation is read-only.

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 two short sentences that are front-loaded with the primary action and output detail. There is no redundant phrasing or unnecessary elaboration.

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

Completeness4/5

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

Given the moderate complexity, the full parameter descriptions in the schema, and the absence of an output schema, the description adequately covers the purpose and return values. It does not cover edge cases like no definition found or server errors, but for a straightforward lookup tool this is a minor gap.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema provides 100% coverage with descriptions for all four parameters (col, line, path, bufnr), including defaults and constraints. The description adds no extra parameter semantics beyond referencing 'a position,' so the baseline of 3 is appropriate.

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's function with a specific verb and resource: 'Resolve the definition location(s) of the symbol at a position.' It also explains the output format, and it is distinguishable from LSP siblings like hover, references, and rename.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The intended use is implied by the title and description, but no explicit guidance is given about when to use this tool versus alternatives like nvim_lsp_references or nvim_lsp_hover. There are no exclusions or when-not-to-use conditions.

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/Shooooooooo/nvim-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server