[semantic]
Searches for a literal string or regex pattern across solution documents (non-semantic).
Try this tool in Playground.
| Name | Type | Required | Description |
|---|---|---|---|
| query | string | No | Search query (literal string by default). Preferred argument name. |
| pattern | string | No | Backward-compatible alias for query. |
| useRegex | boolean | No | Treat pattern as a .NET regex. Default is false. |
| caseSensitive | boolean | No | Case-sensitive match. Default is false. |
| scope | json | No | Optional search scope. |
| skip | number | No | Pagination offset. Default is 0. |
| take | number | No | Pagination size. Default is 200. |
| maxLineTextChars | number | No | Max characters for lineText. Use 0 for unlimited. 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 TODO comments
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "search_text",
"arguments": {
"query": "TODO"
}
}
}{
"success": true,
"data": {
"pattern": "TODO",
"useRegex": false,
"caseSensitive": false,
"scopeUsed": {
"mode": "solution"
},
"matchCount": 2,
"projectsSearched": 2,
"totalProjectsInWorkspace": 2,
"documentsMatchedScope": 120,
"documentsSearched": 120,
"documentsWithMatches": 1,
"documentsUnreadable": 0,
"totalDocumentsInWorkspace": 120,
"paging": {
"skip": 0,
"take": 200,
"returned": 2,
"total": 2
},
"matches": [
{
"filePath": "/path/to/Program.cs",
"lineNumber": 12,
"column": 1,
"lineText": "// TODO: refactor this",
"projectName": "MyProject"
}
],
"hints": {
"nextSteps": [
"Use get_symbol_at_position if the match is an identifier and you want a symbolKey",
"Use search_symbols for semantic discovery once you know a symbol name"
],
"scopeNote": null,
"noMatchNote": null,
"unreadableNote": null
}
},
"meta": {
"durationMs": 123,
"cancelled": false,
"timedOut": false,
"timeoutMs": 300000
},
"error": null
}Returns matching text occurrences (with paging)