Skip to main content
Glama
famtong8-dev

W3 MCP LSP Server

by famtong8-dev

lsp_goto_definition

Read-onlyIdempotent

Locate a symbol's definition in JavaScript/TypeScript code. Given a file and 0-indexed cursor position, returns the definition's file:line:column or 'Definition not found'.

Instructions

Jump to symbol definition location.

šŸ”“ CRITICAL: Line and character are STRICTLY 0-INDEXED (0, 1, 2...), NOT 1-indexed!

āŒ WRONG (what editor displays): Editor shows: "Ln 5, Col 10" āŒ DON'T use: {"line": 5, "character": 10}

āœ… CORRECT (0-indexed): āœ… DO use: {"line": 4, "character": 9} Formula: lsp_value = editor_value - 1

CHARACTER COUNTING (0-indexed from start of line): Line: "const greeting = "Hello";" Index: 0123456789... • 'c' in const → character: 0 • 'o' in const → character: 1 • 'g' in greeting → character: 6 • 'H' in string → character: 18

Args: params (LSPInput): Must provide line and character as 0-indexed values

Returns: str: "file:line:column" or "Definition not found"

Example: āœ… {"file_path": "src/app.ts", "line": 4, "character": 9} → "/path/src/app.ts:15:5"

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
paramsYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, and idempotentHint=true, covering the safety profile. The description adds valuable behavioral context: the strict 0-indexing requirement, the return format ('file:line:column' or 'Definition not found'), and an example. This goes beyond what annotations convey.

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 well-organized with headers, a critical warning, examples, and a return type. It is longer than minimal but justified by the tricky 0-indexing nuance. Some redundancy exists (e.g., repeated indexing formulas), but the structure and front-loaded purpose keep it effective.

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?

With annotations covering safety and an output schema presumably present, the description thoroughly covers purpose, parameters, return value, and a detailed example. It even explains edge-case conversion. It is complete for a tool of this complexity.

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?

Despite the schema having descriptive parameter entries, the context indicates 0% schema description coverage. The description fully compensates by explicitly stating the 0-indexing requirement, providing conversion formulas, and offering a concrete example with file_path. It clearly explains how to interpret and provide each parameter.

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 starts with a clear and specific verb+resource phrase: 'Jump to symbol definition location.' This precisely distinguishes it from sibling tools like lsp_hover (show info) and lsp_find_references (find usages). The purpose is unambiguous.

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 description clearly implies the use case (navigate to a symbol's definition) but does not explicitly state when to prefer this over alternatives or mention exclusions. Sibling tools exist but are not referenced, so the guidance is implied rather than explicit.

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/famtong8-dev/w3-mcp-server-lsp'

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