Skip to main content
Glama

Load Project

load_project

Load a Svelte project by specifying its root directory path. This action restarts the language server to switch between different Svelte projects at runtime.

Instructions

Load a Svelte project by its root directory. Restarts the language server pointed at the new workspace. Call this to switch between projects at runtime.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesAbsolute path to the Svelte project root directory

Implementation Reference

  • The handler function for the 'load_project' tool which resolves the path and calls the LSP client's loadProject method.
    async ({ path }): Promise<ToolResult> => {
      try {
        const resolved = resolve(path);
        if (!existsSync(resolved)) {
          return textResult(`Directory not found: ${resolved}`);
        }
        await lsp.loadProject(resolved);
        return textResult(
          `Loaded project '${basename(resolved)}'. Language server is indexing - first requests may be slow.`
        );
      } catch (ex) {
        return textResult(formatError(ex));
      }
    }
  • Input schema definition for the 'load_project' tool using zod.
    inputSchema: {
      path: z
        .string()
        .describe(
          "Absolute path to the Svelte project root directory"
        ),
    },
  • Registration of the 'load_project' tool in the McpServer.
    server.registerTool(
      "load_project",
      {
        title: "Load Project",
        description:
          "Load a Svelte project by its root directory. Restarts the language server pointed at the new workspace. Call this to switch between projects at runtime.",
        inputSchema: {
          path: z
            .string()
            .describe(
              "Absolute path to the Svelte project root directory"
            ),
        },
      },
      async ({ path }): Promise<ToolResult> => {
        try {
          const resolved = resolve(path);
          if (!existsSync(resolved)) {
            return textResult(`Directory not found: ${resolved}`);
          }
          await lsp.loadProject(resolved);
          return textResult(
            `Loaded project '${basename(resolved)}'. Language server is indexing - first requests may be slow.`
          );
        } catch (ex) {
          return textResult(formatError(ex));
        }
      }
    );
Behavior3/5

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

With no annotations provided, the description carries the full burden. It discloses that the tool restarts the language server and enables project switching, which are important behavioral traits. However, it doesn't mention potential side effects like losing current session state, performance implications, or error handling.

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?

Two sentences that are tightly focused and front-loaded with the core functionality. Every word earns its place with no redundancy or unnecessary elaboration.

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

Completeness4/5

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

For a single-parameter tool with no output schema and no annotations, the description provides good context about what the tool does and when to use it. However, it could benefit from mentioning what happens after loading (e.g., confirmation of success/failure) since there's no output schema.

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%, so the schema already documents the 'path' parameter adequately. The description doesn't add any additional parameter semantics beyond what's in the schema, maintaining the baseline score.

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 clearly states the action ('Load a Svelte project') and the resource ('by its root directory'), with additional context about restarting the language server. It distinguishes from siblings like 'restart_lsp' by specifying project-switching functionality.

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

Usage Guidelines4/5

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

The description provides clear context for when to use it ('to switch between projects at runtime'), but doesn't explicitly mention when NOT to use it or compare it to alternatives like 'restart_lsp' which might handle server restarts differently.

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/adainrivers/SvelteLS.MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server