Browse documentation

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”.

Try it locally in the Glider playground

Parameters

NameTypeRequiredDescription
kindsstringNoOptional kinds filter (comma-separated). Type, Class, Interface, Struct, Enum, Delegate, Method, Property, Field, Event, Namespace. Type means any named type; the rest match the kind a result reports.
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 scope. Omit scope to search the solution. When supplied, set mode to solution, project, document, or pathPrefix. project requires projectName. document requires filePath. pathPrefix requires pathPrefix. Paths can be absolute or relative to solutionRoot. Set includeExternal to true when the tool supports external symbols.
skipnumberNoPagination offset. Default is 0. Default: 0
takenumberNoPagination size. Default is 200. Default: 200
pathStylestringNoPath style: 'absolute' (default) or 'relative' (to solution root). Default: "absolute"
responseDetailstringNocompact returns results and actionable state. full adds diagnostic metadata under responseDiagnostics. Default: "compact"

Examples

Replace sample paths and symbol keys with values from your workspace.

Find async methods missing CancellationToken

Arguments
{
  "kinds": "Method",
  "modifiers": "async",
  "mustNotHaveParameterType": "CancellationToken"
}
Full MCP request
Full MCP request
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "semantic_query",
    "arguments": {
      "kinds": "Method",
      "modifiers": "async",
      "mustNotHaveParameterType": "CancellationToken"
    }
  }
}
Illustrative response
{
  "success": true,
  "matchCount": 1,
  "paging": {
    "total": 1
  },
  "matches": [
    {
      "name": "SaveAsync",
      "fullName": "MyApp.Data.UserRepository.SaveAsync(User user)",
      "kind": "Method",
      "symbolKey": "...",
      "filePath": "/path/to/UserRepository.cs",
      "lineNumber": 88,
      "projectName": "MyProject"
    }
  ]
}

Response Notes

Returns matching symbols (with paging) including symbol keys Results use top-level fields with success. Compact is the default; full adds responseDiagnostics. Both modes retain errors, coverage, partial state, and recovery advice.