Skip to main content
Glama

Get Hover Info

get_hover

Retrieve documentation and type information for Svelte symbols to understand code functionality and structure during development.

Instructions

Get hover documentation and type info for a symbol.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filePathYesAbsolute path to the file
symbolNameYesName of the symbol to find
symbolKindNoKind of symbol

Implementation Reference

  • The handler function for the get_hover tool, which prepares the symbol request and calls the LSP's textDocument/hover method.
    async ({ filePath, symbolName, symbolKind }): 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/hover",
          makePositionParams(prep.ctx)
        );
    
        if (!result) return textResult("No hover information available.");
    
        const contents = result.contents;
        if (!contents) return textResult("No hover information available.");
    
        if (typeof contents === "string") return textResult(contents);
        if (contents.value) return textResult(contents.value);
    
        if (Array.isArray(contents)) {
          const parts: string[] = [];
          for (const item of contents) {
            if (typeof item === "string") parts.push(item);
            else if (item.value) parts.push(item.value);
          }
          return textResult(parts.join("\n"));
        }
  • The registration of the get_hover tool in the MCP server, including its schema and metadata.
    server.registerTool(
      "get_hover",
      {
        title: "Get Hover Info",
        description:
          "Get hover documentation and type info for a symbol.",
        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"),
        }),
      },
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool retrieves information, implying a read-only operation, but lacks details on permissions, rate limits, error handling, or what the output entails (e.g., format or content of hover info). This is a significant gap for a tool with no annotation coverage.

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?

The description is a single, efficient sentence that directly states the tool's purpose without any unnecessary words. It is front-loaded and appropriately sized, making it easy to understand at a glance, which is ideal for conciseness.

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?

Given the complexity of code analysis tools and the lack of annotations and output schema, the description is incomplete. It doesn't explain what 'hover documentation and type info' entails, how it differs from other symbol-related tools, or any behavioral aspects, leaving gaps that could hinder effective use by an AI agent.

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 all parameters ('filePath', 'symbolName', 'symbolKind') with clear descriptions. The description adds no additional meaning beyond what the schema provides, such as examples or usage context for the parameters, but meets the baseline since the schema handles the heavy lifting.

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 clearly states the tool's purpose with a specific verb ('Get') and resource ('hover documentation and type info for a symbol'), making it understandable. However, it doesn't explicitly differentiate from similar sibling tools like 'get_signature_help' or 'find_definition', which might also provide related information about symbols, leaving some ambiguity about its unique scope.

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?

The description provides no guidance on when to use this tool versus alternatives. With many sibling tools related to code analysis (e.g., 'find_definition', 'get_signature_help', 'get_completion'), there is no indication of specific contexts, prerequisites, or exclusions for using 'get_hover', which could lead to confusion in tool selection.

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