Skip to main content
Glama

clangd_hover

Read-only

Returns type and documentation for a C++ symbol at a given line and character position, aiding code understanding. Empty configurations query all available contexts.

Instructions

Describe the symbol at a one-based line and zero-based code-point position.

Omitted or empty configurations select all available contexts.

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": {
      "path": "<path>",
      "position": "<position>"
    },
    "name": "clangd_hover"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYes
timeoutNo
positionYes
configurationsNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.5.1
    • addedInput schema / additionalProperties
      Added value: +false
  2. Addedv0.2.2

TDQS

C2.9/5.0
Behavior2/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, so the safety profile is covered, but the description adds essentially no behavioral context beyond that — it does not say what the hover result contains, that the file must belong to an indexed project, or what happens when no symbol is found. The one extra sentence describes a parameter default rather than tool behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two short sentences, front-loaded with the primary action and coordinate conventions, with no filler. The second sentence is slightly orphaned (it is a parameter note rather than usage guidance) but still earns its place.

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?

An output schema exists, so return values need not be described, but for a four-parameter tool with zero schema coverage the definition is thin: `path` and `timeout` are undocumented and no environment prerequisites are mentioned. An agent could not confidently construct a call from this text alone.

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 reported at 0%, so the description must compensate; it does explain the line/character base conventions and that empty configurations means all contexts, which maps to two of four parameters. It leaves `path` and `timeout` completely unexplained (what kind of path, units/meaning of the 30-second timeout), so compensation is only partial.

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 ("Describe the symbol") qualified by a precise coordinate convention (one-based line, zero-based code point), which is enough to tell it apart from clangd_definition or clangd_references. It never names those siblings explicitly, so differentiation is inferred rather than stated.

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?

There is no when-to-use guidance at all: nothing says to prefer this over clangd_definition, clangd_document_symbols, or clangd_diagnostics, nor any prerequisite such as an active clangd session or a compile_commands.json. The only guidance sentence concerns a parameter default (configurations), not tool selection.

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