Skip to main content
Glama
Svelte LSP as MCP

Svelte LSP as MCP

by pacnpal

svelte_definition

Read-only

Locate the definition of a Svelte symbol at a given line and character position, using a saved component file or inline source.

Instructions

Find where the symbol at a position is defined.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "position": "<position>"
    },
    "name": "svelte_definition"
  }
}

Input Schema

NameRequiredDescriptionDefault
fileNoPath to a saved .svelte component inside the workspace. Relative paths start at the workspace root.
sourceNoFull Svelte component source. Supply source or file. Source uses the bundled Svelte runtime.
positionYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.0

TDQS

C2.9/5.0
Behavior2/5

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

The annotations already declare that this is a read-only, non-destructive, workspace-local operation, so safety is covered. Beyond that, the description adds almost nothing: it does not say what comes back, how a symbol with no definition is handled, or how the bundled Svelte runtime affects resolution. For a tool whose annotations carry the whole safety profile and whose behavior is otherwise left unexplained, this is a significant gap.

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?

It is a single, front-loaded sentence with no wasted words. It is efficient, but it is also too terse for a tool whose return value and file-versus-source selection need explanation.

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

Completeness2/5

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

There is no output schema, so the description is responsible for explaining that a definition location (or no result) comes back, yet it says nothing about return values. For a tool with a nested position object and two alternative input sources, the one-sentence description leaves too much for the agent to guess.

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

Parameters2/5

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

The input schema documents all three parameters, including the zero-based line and character offsets and the workspace-relative file path, at 67% coverage. The description adds no meaning of its own: it does not explain the source versus file choice, their mutual exclusivity, or what 'position' must point at. It could be tightened to compensate for the moderate gap in the schema, but it does not.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names a specific action and outcome: locate the definition of the symbol at a given position. That is clearly a go-to-definition operation, but it does not differentiate itself from the sibling svelte_type_definition or svelte_references, so an agent must infer which one to pick.

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?

Usage is only implied by the phrasing: if you have a symbol at a position and want its definition, use this. The description never says when not to use it, or how it relates to the sibling tools such as svelte_type_definition or svelte_references, so an agent has to infer the boundaries between them.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.