Skip to main content
Glama
famtong8-dev

W3 MCP LSP Server

by famtong8-dev

lsp_find_references

Read-onlyIdempotent

Find all references to a symbol at a specified line and character in a JavaScript/TypeScript file, outputting each occurrence's file, line, and column.

Instructions

Find all usages/references of symbol at position.

🔴 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: "Found N references:

file:line:column ..." or "No references found"

Example:
    ✅ {"file_path": "src/app.ts", "line": 4, "character": 9}
    → "Found 2 references:

/path/src/app.ts:5:9 /path/src/utils.ts:10:2"

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
paramsYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

The description goes well beyond annotations by emphasizing the strict 0-indexing requirement, providing a conversion formula, and detailing the exact return format with examples. This is critical behavioral information not covered by the readOnlyHint or idempotentHint annotations.

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-structured with clear sections (CRITICAL, WRONG, CORRECT, Example), but it is somewhat lengthy and repeats examples also found in the nested schema. It remains front-loaded with the primary purpose and key constraint.

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?

The description is comprehensive for this tool: it covers input requirements, output format, and provides a worked example. Given the tool's complexity and the presence of an output schema, this description provides all necessary context for correct 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?

The description explains each parameter (line, character, file_path) with concrete examples and the conversion formula from editor to LSP indexing. This adds significant meaning beyond the minimal top-level schema description, compensating for the 0% schema description coverage.

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 opens with 'Find all usages/references of symbol at position,' which clearly states the tool's function with a specific verb and resource. This distinguishes it from sibling tools like lsp_goto_definition and lsp_hover by its focus on references.

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 implies usage (finding references) but does not explicitly contrast this tool with alternatives like lsp_goto_definition or lsp_hover, nor does it state when not to use it. Thus, the usage is clear from context but lacks explicit guidance.

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