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
| Name | Type | Required | Description |
|---|---|---|---|
| kinds | string | No | Optional 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. |
| namePattern | string | No | Optional name pattern (wildcards '*' and '?' supported). |
| modifiers | string | No | Optional modifiers (comma-separated): 'async,static,virtual,abstract'. |
| mustHaveParameterType | string | No | Optional required parameter types (comma-separated). Methods only. |
| mustNotHaveParameterType | string | No | Optional excluded parameter types (comma-separated). Methods only. |
| mustHaveAttribute | string | No | Optional required attributes (comma-separated). |
| mustNotHaveAttribute | string | No | Optional excluded attributes (comma-separated). |
| returnType | string | No | Optional return type patterns (comma-separated). Methods only. |
| scope | json | No | Optional 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. |
| skip | number | No | Pagination offset. Default is 0. Default: 0 |
| take | number | No | Pagination size. Default is 200. Default: 200 |
| pathStyle | string | No | Path style: 'absolute' (default) or 'relative' (to solution root). Default: "absolute" |
| responseDetail | string | No | compact 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.