Skip to main content
Glama
Svelte LSP as MCP

Svelte LSP as MCP

by pacnpal

svelte_diagnostics

Read-only

Retrieve current compiler, markup, CSS, and TypeScript diagnostics for a saved or inline Svelte component to find errors before build or runtime.

Instructions

Get current compiler, markup, CSS and TypeScript diagnostics for a component.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "svelte_diagnostics"
  }
}

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.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.0

TDQS

B3.3/5.0
Behavior3/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 by structured data. The description adds useful context by naming the four diagnostic sources returned, which matters because there is no output schema, but it omits practical behavior such as whether diagnostics come from a running language server, how compile failures surface, or whether both file and source can be passed.

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?

A single front-loaded sentence with no preamble, hedging, or redundancy; every word identifies what is returned and for what artifact. Nothing could be removed without losing information.

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

Completeness3/5

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

With no output schema, the description does at least enumerate the diagnostic categories an agent will receive, which is the most important return-value information. However, for a tool with two optional parameters that can be supplied in combination, it says nothing about the effect of passing both, passing neither, or how error conditions are reported, leaving the definition minimally adequate.

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 description coverage is 100%, and the schema itself explains the file path semantics, the "supply source or file" relationship, and the bundled runtime note. The description adds no parameter-level meaning beyond that, so the baseline of 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 pairs a specific verb ("Get") with a specific resource ("current compiler, markup, CSS and TypeScript diagnostics for a component") and enumerates the diagnostic categories, which cleanly separates it from the other language-server siblings like svelte_completions, svelte_hover, and svelte_format. It stops short of explicitly naming a sibling it must not be confused with, so it is clear but not maximally differentiated.

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 statement, no prerequisite (e.g. a language server or saved file), and no exclusions or alternatives named. An agent can infer the tool is for checking a component's errors, but nothing tells it when to prefer this over svelte_hover or svelte_document_symbols.

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