Home / Directory / Svelte / svelte-autofixer
Svelte autofixer
An MCP tool from the Svelte server, run by Svelte.
Given a svelte component or module returns a list of suggestions to fix any issues it has. This tool MUST be used whenever the user is asking to write svelte code before sending the code back to the user
Name on the gateway: svelte__svelte-autofixer.
Parameters
| Name | Type | Description |
|---|---|---|
code required | string | |
desired_svelte_version required | mixed | The desired svelte version as a full semver string (e.g. "5.16.0", the major MUST be 4 or 5)...you MUST read this from the package.json of the user project (or from the installed node_modules/svelte/package.json) since some suggestions are only enabled for newer versions. If you can't find it use some hint from the wording (if the user asks for runes it wants version 5) and pass only the major. Default to 5 in case of doubt. |
async | boolean | If true the code is an async component/module and might use await in the markup or top-level awaits in the script tag. If possible check the svelte.config.js/svelte.config.ts to check if the option is enabled otherwise asks the user if they prefer using it or not. You can only use this option if the version is 5. |
filename | string | The filename of the component if available, it MUST be only the Component name with .svelte or .svelte.ts extension and not the entire path. |
How to call it
Through the Smart Gateway, any client can run it by name with call_tool, or let the gateway find it with search_tools:
{
"name": "svelte__svelte-autofixer",
"arguments": {
"code": "…",
"desired_svelte_version": "…"
}
}The first call connects Svelte to your account automatically; nothing to set up. About this server.
Try asking
Use the svelte autofixer tool with code set to ….