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

dsh-mcp-server-clangd

by Rcyc-1025

clangd_workspace_symbols

Read-onlyIdempotent

Finds C/C++ workspace symbols by fuzzy name query with clangd and returns relevance-ordered matches capped by a limit; a non-empty query prevents full-index results.

Instructions

在工作区内按名称模糊搜索符号(workspace/symbol)。query 必填且不能为空(避免返回全量索引);结果按 clangd 相关性顺序,超过 limit 截断。

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": {
      "query": "<query>"
    },
    "name": "clangd_workspace_symbols"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNo最多返回多少条,默认 50
queryYes符号名或片段(模糊匹配),1..128 字符

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.5/5.0
Behavior3/5

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

The annotations already declare readOnlyHint, idempotentHint, and openWorldHint=false, so the safety profile is covered. The description adds useful behavior that the annotations do not cover: results come back in clangd relevance order rather than sorted, and they are truncated past limit. It says nothing about result shape, empty-result behavior, or what happens with an unroutable query.

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?

The text packs three short clauses: scope and method, query constraint with rationale, and ordering and truncation. The ordering and truncation detail is front-loaded and there is no filler. A slightly cleaner split between parameters and result behavior would earn a 5.

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?

This is a two-parameter read-only tool with full schema coverage, annotations, and no output schema. The description covers scope, the constraint on the required parameter, and ordering and truncation behavior, which is nearly complete. The remaining gap is that it does not describe what a symbol record contains.

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 coverage is 100%, and both bounds, max 200 for limit and 1..128 for query, are already documented in the schema. The description adds only the reason the query must be non-empty and notes that limit truncates results. These are minor additions beyond a schema that already does 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 states a specific verb and scope: fuzzy search for symbols by name across the whole workspace, and it cites the underlying LSP method (workspace/symbol). This clearly separates it from document-scoped siblings in meaning, but it never names those siblings, so an agent must infer the workspace-vs-document distinction.

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?

The description gives a rule about the query, specifically that the query is required and cannot be empty to avoid a full-index dump, which is practical when-to-use guidance. It never states when to prefer this tool over clangd_document_symbols or clangd_definition, and it gives no exclusions.

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