Skip to main content
Glama

go_to_implementation

Find implementations of interfaces or abstract methods in Svelte projects to navigate code structure and understand component relationships.

Instructions

Find implementations of an interface or abstract method.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filePathYesAbsolute path to the file
symbolNameYesName of the symbol to find
symbolKindNoKind of symbol
filterNoOptional regex filter on symbol/file names in results
limitNoMax results to return. Default: 50

Implementation Reference

  • The "go_to_implementation" tool is registered and implemented in src/tools/navigation.ts. It uses the `prepareSymbolRequest` helper to find the context, then requests `textDocument/implementation` from the LSP, and finally formats the results using `formatLocations`.
    server.registerTool(
      "go_to_implementation",
      {
        title: "Go to Implementation",
        description:
          "Find implementations of an interface or abstract method.",
        inputSchema: z.object({
          filePath: z.string().describe("Absolute path to the file"),
          symbolName: z.string().describe("Name of the symbol to find"),
          symbolKind: z.string().optional().describe("Kind of symbol"),
          filter: z
            .string()
            .optional()
            .describe("Optional regex filter on symbol/file names in results"),
          limit: z
            .number()
            .default(50)
            .describe("Max results to return. Default: 50"),
        }),
      },
      async ({
        filePath,
        symbolName,
        symbolKind,
        filter,
        limit,
      }): Promise<ToolResult> => {
        try {
          const prep = await prepareSymbolRequest(lsp, filePath, symbolName, symbolKind);
          if ("error" in prep) return textResult(prep.error);
    
          const result = await lsp.request(
            "textDocument/implementation",
            makePositionParams(prep.ctx)
          );
          return textResult(formatLocations(result, "implementation", filter, limit));
        } catch (ex) {
          return textResult(formatError(ex));
        }
      }
    );

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