find_references

[references]

Finds all references to a symbol. Requires a symbolKey (use resolve_symbol or search_symbols to get one). Supports scope/filtering/grouping/paging.

Try this tool in Playground.

Parameters

NameTypeRequiredDescription
symbolKeystringYesOpaque symbolKey from search_symbols, resolve_symbol, get_symbol_at_position, or any tool that returns symbolKey. Not a name.
scopejsonNoOptional scope. Example: { "kind": "solution" } or { "kind": "project", "projectName": "MyProject" }. Set includeExternal=true where supported.
referenceKindsstringNoOptional filter (comma-separated): 'Read,Write,Invocation,TypeArgument,NameOf,Attribute'.
includeLineTextbooleanNoInclude lineText for each reference. Default is true.
maxLineTextCharsnumberNoMax characters for lineText. Use 0 for unlimited. Default is 200.
groupBystringNoGrouping: 'file', 'project', 'containingSymbol', or 'none' (default).
pathStylestringNoPath style: 'absolute' (default) or 'relative' (to solution root).
skipnumberNoPagination offset. Default is 0.
takenumberNoPagination size. Default is 200.
timeout_msnumberNoTimeout in milliseconds (5 minutes). Use 0 to disable. Default is 300000.

Examples

Find references for a symbolKey

Request
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "find_references",
    "arguments": {
      "symbolKey": "..."
    }
  }
}
Response
{
  "success": true,
  "data": {
    "symbolKey": "...",
    "referenceCount": 15,
    "paging": {
      "skip": 0,
      "take": 200,
      "returned": 15,
      "total": 15
    },
    "references": [
      {
        "filePath": "/path/to/Program.cs",
        "lineNumber": 9,
        "column": 35,
        "lineText": "builder.Services.AddSingleton<ISolutionManager, SolutionManager>();",
        "projectName": "MyProject",
        "referenceKind": "TypeArgument"
      }
    ]
  },
  "error": null
}

Response Notes

Returns reference locations (with paging)