Skip to main content
Glama
dsh-mcp-server-clangd

dsh-mcp-server-clangd

by Rcyc-1025

clangd_hover

Read-onlyIdempotent

Retrieves hover information for a C/C++ symbol at a given 1-based line and column, including its type, declaration, and comments.

Instructions

查询某个位置符号的悬停信息(textDocument/hover):类型、声明、注释。输入 1-based line/column,返回 contents 文本及其 markdown/plaintext 类型。

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "file": "<file>",
      "line": "<line>",
      "column": "<column>"
    },
    "name": "clangd_hover"
  }
}

Input Schema

NameRequiredDescriptionDefault
fileYes源文件路径:绝对路径,或相对 projectRoot 的路径
lineYes1-based 行号
columnYes1-based 列号(UTF-16)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint and openWorldHint=false, so safety profile is covered. The description adds that positions are 1-based and that the result carries a markdown/plaintext kind, which is real value. It stops short of saying what happens when there is no hover at a position, which is the main behavioral unknown for this tool.

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 short sentences, both front-loaded: the operation and its LSP anchor first, then the input convention and return shape. No filler and nothing is buried.

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?

With no output schema present, the description usefully sketches the return value (contents plus markdown/plaintext kind), which is exactly what the agent needs. For a simple three-parameter read tool with full annotation coverage, the only gap is the empty/no-hover case.

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%, including that line and column are 1-based and column is UTF-16. The description repeats the 1-based convention but adds no parameter detail beyond the schema, 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 names a specific verb and resource ('查询某个位置符号的悬停信息') and grounds it in the LSP method textDocument/hover, plus what it surfaces (类型、声明、注释). It does not contrast with siblings such as clangd_definition, but the hover-specific content (comments, types) is distinctive enough to identify it.

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

Usage Guidelines3/5

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

Usage is implied through the required position parameters and the stated positional lookup, so an agent can infer it must call this at a location. No explicit when-to-use versus clangd_definition or clangd_references is given, and no prerequisites or failure conditions are mentioned.

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