Skip to main content
Glama

clangd_definition

Read-only

Finds the definition of a C++ symbol at a specified source position, helping you navigate code and resolve symbol references.

Instructions

Find definitions of the symbol at the supplied position.

External locations use root/. Empty configurations select all.

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_definition"
  }
}

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
Behavior3/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. The description adds two genuinely useful behavioral facts beyond annotations: external locations are resolved relative to root, and an empty configurations list selects all. It omits prerequisites such as whether the file must be open or indexed, and whether multiple definitions can be returned.

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 with the core action front-loaded and no filler. The second sentence is terse to the point of jargon ("External locations use root/") and could be clearer without becoming longer.

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 explained, but a 4-parameter LSP tool with 0% schema coverage and five closely related clangd siblings needs more: what path means, timeout semantics, and when to prefer references/hover over definition. The description covers only the configuration-selection behavior.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0% at the property level, so path, timeout, and the top-level position parameter are undocumented in the schema. The description only indirectly explains configurations ("Empty configurations select all") and refers to position without clarifying it; path (file vs. directory, absolute vs. relative) and timeout units get no help anywhere.

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?

States a specific verb and resource: "Find definitions of the symbol at the supplied position." An agent immediately knows this is a go-to-definition operation. It does not explicitly differentiate itself from sibling clangd_hover, clangd_references, or clangd_workspace_symbols, which are the most likely confusions.

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?

No when-to-use or when-not-to-use guidance, and no mention of alternatives such as clangd_references for finding usages or clangd_hover for type info. The only contextual hint is the implicit "at the supplied position", which an agent must infer means a symbol occurrence in an already-known file.

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