semantic_query

[semantic]

Finds symbols by semantic predicates (kinds, name patterns, modifiers, parameter/return types, and attributes). Useful for queries like “async methods without CancellationToken”.

Why this tool exists

Some questions are code-structure questions, not string-search questions.

How it helps the agent

The model can query semantic properties or fall back to text search intentionally, keeping each search aligned with the kind of evidence needed.

Try it locally in the GliderMCP playground

Parameters

NameTypeRequiredDescription
kindsstringNoOptional kinds (comma-separated): 'Type,Method,Property,Field,Event,Namespace'.
namePatternstringNoOptional name pattern (wildcards '*' and '?' supported).
modifiersstringNoOptional modifiers (comma-separated): 'async,static,virtual,abstract'.
mustHaveParameterTypestringNoOptional required parameter types (comma-separated). Methods only.
mustNotHaveParameterTypestringNoOptional excluded parameter types (comma-separated). Methods only.
mustHaveAttributestringNoOptional required attributes (comma-separated).
mustNotHaveAttributestringNoOptional excluded attributes (comma-separated).
returnTypestringNoOptional return type patterns (comma-separated). Methods only.
scopejsonNoOptional search scope.
skipnumberNoPagination offset. Default is 0.
takenumberNoPagination size. Default is 200.
pathStylestringNoPath style: 'absolute' (default) or 'relative' (to solution root).

Examples

Find async methods missing CancellationToken

Request
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "semantic_query",
    "arguments": {
      "kinds": "Method",
      "modifiers": "async",
      "mustNotHaveParameterType": "CancellationToken"
    }
  }
}
Response
{
  "success": true,
  "data": {
    "matchCount": 1,
    "paging": {
      "skip": 0,
      "take": 200,
      "returned": 1,
      "total": 1
    },
    "matches": [
      {
        "name": "SaveAsync",
        "fullName": "MyApp.Data.UserRepository.SaveAsync(User user)",
        "kind": "Method",
        "symbolKey": "...",
        "filePath": "/path/to/UserRepository.cs",
        "lineNumber": 88,
        "projectName": "MyProject"
      }
    ]
  },
  "error": null
}

Response Notes

Returns matching symbols (with paging) including symbol keys

↑/↓ NavigateEnter OpenSpace Expand