[semantic]
Finds symbols by semantic predicates (kinds, name patterns, modifiers, parameter/return types, and attributes). Useful for queries like “async methods without CancellationToken”.
Try this tool in Playground.
| Name | Type | Required | Description |
|---|---|---|---|
| kinds | string | No | Optional kinds (comma-separated): 'Type,Method,Property,Field,Event,Namespace'. |
| 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 search scope. |
| skip | number | No | Pagination offset. Default is 0. |
| take | number | No | Pagination size. Default is 200. |
| pathStyle | string | No | Path style: 'absolute' (default) or 'relative' (to solution root). |
| timeout_ms | number | No | Timeout in milliseconds (5 minutes). Use 0 to disable. Default is 300000. |
Find async methods missing CancellationToken
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "semantic_query",
"arguments": {
"kinds": "Method",
"modifiers": "async",
"mustNotHaveParameterType": "CancellationToken"
}
}
}{
"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
}Returns matching symbols (with paging) including symbol keys