Skip to main content
Glama
crosspad-mcp-server

crosspad-mcp-server

Official
by CrossPad

Ask clangd about a C/C++ symbol

crosspad_symbol
Read-onlyIdempotent

Locate C/C++ symbol definitions, references, implementations, and callers via clangd; get hover type docs and file outlines from compile_commands.json.

Instructions

Compiler-backed symbol intelligence via clangd: references, implementations, hover, call hierarchy, definition and a file's symbol outline. It reads the project's compile_commands.json: references (who calls this), implementations (what overrides this virtual), hover (resolved type and doc comment), call_hierarchy (incoming callers), definition, document_symbols (outline of one file). Give a symbol name (resolved through clangd's index) or an exact file + line (+ character), 1-based. project picks pc or idf; by default whichever was built most recently. Needs clangd (found on PATH or in an ESP-IDF, emsdk, Homebrew, Xcode or VS Code install) and a build that emitted compile_commands.json (crosspad_build); both are reported as typed errors, never a hang. With no clangd at all, definition and references fall back to an approximate text search (engine: text). The FIRST call on a cold tree can take a minute or two while the index builds (platform-idf is ~1950 translation units). For a plain 'where is X declared' across every repo, crosspad_search_symbols is cheaper.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "crosspad_symbol"
  }
}

Input Schema

NameRequiredDescriptionDefault
fileNoSource file — absolute, or relative to the project root. Required for document_symbols
lineNo1-based line, when pointing at an exact position instead of naming a symbol
limitNoMaximum results (default 30)
actionNoWhat to ask clangd (default: definition)definition
symbolNoSymbol name, optionally qualified: 'PadManager' or 'PadManager::handlePadPress'
projectNoWhich compilation database to index (default: the most recently built)
characterNo1-based column within `line` (default 1)

Output Schema

NameRequiredDescriptionDefault
docsNo
nextNo
noteNo
callsNo
countNo
errorNo
hoverNo
actionNo
clangdNo
engineNo
noticeNo
projectNo
successYes
symbolsNo
indexingNo
resolvedNo
locationsNo
truncatedNo
candidatesNo
approximateNo
install_hintNo
compile_commandsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv11.0.0

TDQS

A4.2/5.0
Behavior3/5

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

Annotations already declare readOnlyHint/idempotentHint/destructiveHint=false, so safety is covered. The description nonetheless adds substantial non-obvious behavior: hard prerequisites on clangd and compile_commands.json, typed errors instead of hangs, a degraded text-search fallback for `definition`/`references` signalled as `engine: text`, and cold-index latency of a minute or two at ~1950 translation units. That is meaningful disclosure beyond the annotations.

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?

Front-loaded with the purpose and action list, then prerequisites and caveats. It is a single dense paragraph with some run-on packing (fallback and error semantics interleaved); bullet separation would improve scanability, but essentially every clause carries decision-relevant information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/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 shape need not be explained. Given a 7-parameter, 6-action tool with environmental prerequisites, the description covers the gaps an agent actually needs: prerequisites, failure mode (typed errors, no hang), degraded mode, latency on a cold tree, and the cheaper sibling for simple lookups.

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 every parameter including defaults and 1-based indexing; per the rubric that sets a baseline of 3. The description adds a little relational meaning — that `symbol` is resolved through clangd's index and that symbol-or-position are the two alternative addressing paths — but nothing about `limit` or the action semantics beyond the glosses.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Opens with a specific verb+resource ('Compiler-backed symbol intelligence via clangd') and enumerates the six concrete actions with a plain-language gloss for each ('references (who calls this)', 'implementations (what overrides this virtual)'). It also explicitly distinguishes itself from crosspad_search_symbols, so an agent can separate the two without opening either schema.

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

Usage Guidelines5/5

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

States the two addressing modes (a resolved `symbol` name vs. an exact `file`+`line`+`character`) and how `project` chooses a compilation database. It names the alternative explicitly: for a plain 'where is X declared' across every repo, crosspad_search_symbols is cheaper — a direct when-not-to-use rule.

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