Skip to main content
Glama
Svelte LSP as MCP

Svelte LSP as MCP

by pacnpal

svelte_type_definition

Read-only

Find the type declaration of the symbol at a given position in a Svelte component to trace where its type is defined.

Instructions

Find the type declaration of the symbol at a position.

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_type_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?

Annotations already declare readOnlyHint=true, destructiveHint=false, and openWorldHint=false, so the safety profile is covered. Beyond that the description adds nothing: it does not say what happens when the symbol has no type declaration, whether 'file' or 'source' takes precedence, or whether the source path uses a different runtime.

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?

A single short sentence with no filler, and the essential notion (symbol type declaration at a position) is front-loaded. It is efficiently worded but borders on under-specified rather than being padded.

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 should indicate what comes back (a location, a type string, possibly multiple declarations), and it does not. For a tool with a nested position object and two mutually substitutable source inputs, the definition leaves real gaps an agent would have to discover by trial.

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?

Schema coverage is 67% and all three top-level parameters (file, source, position with line/character) carry their own descriptions, including the source-or-file hint and zero-based indexing notes, so the schema does the heavy lifting. The description only echoes 'at a position' and adds no meaning about path resolution, source-vs-file precedence, or UTF-16 offsets, so baseline 3 applies.

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 states a specific verb and resource ('Find the type declaration of the symbol') plus the required locator ('at a position'), so the agent knows this is a go-to-type-definition operation. It never differentiates itself from the sibling svelte_definition, which is the nearest competing tool, so a type-definition vs. definition distinction must be guessed.

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

Usage Guidelines2/5

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

There is no when-to-use guidance, no exclusion, and no mention of an alternative tool; the agent is not told how this differs from svelte_definition or svelte_hover, both of which could plausibly answer similar questions. Usage must be inferred entirely from the name and one-line purpose.

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