search_symbols

[symbols]

Searches symbol index by name pattern (* and ? wildcards). Full-featured: namespace/accessibility filters, sorting, paging. Use for exploration or filtered/sorted results. Returns stable symbolKeys.

Try this tool in Playground.

Parameters

NameTypeRequiredDescription
querystringYesSearch pattern. Supports '*' and '?', or plain text for substring match.
kindsstringNoOptional kinds filter (comma-separated): 'Type,Method,Property,Field,Event'.
namespaceFilterstringNoOptional namespace prefix filter (e.g., 'MyApp.Services').
projectNamestringNoOptional project name filter.
sourceOnlybooleanNoOnly search symbols with source in solution (excludes external assemblies/packages). Default is true.
accessibilitystringNoFilter by accessibility: 'Public', 'Internal', 'Private', 'Protected', 'ProtectedOrInternal', 'ProtectedAndInternal'.
pathStylestringNoPath style: 'absolute' (default) or 'relative' (to solution root).
sortBystringNoOptional sort: 'name', 'kind', 'filePath', 'projectName', 'namespace'.
sortOrderstringNoSort order: 'asc' (default) or 'desc'.
skipnumberNoPagination offset. Default is 0.
takenumberNoPagination size. Default is 200.
timeout_msnumberNoTimeout in milliseconds (5 minutes). Use 0 to disable. Default is 300000.

Examples

Search for service types

Request
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "search_symbols",
    "arguments": {
      "query": "*Service",
      "kinds": "Type"
    }
  }
}
Response
{
  "success": true,
  "data": {
    "query": "*Service",
    "matchCount": 2,
    "paging": {
      "skip": 0,
      "take": 200,
      "returned": 2,
      "total": 2
    },
    "matches": [
      {
        "name": "UserService",
        "fullName": "MyApp.Services.UserService",
        "kind": "Type",
        "containingType": null,
        "namespace": "MyApp.Services",
        "filePath": "/path/to/UserService.cs",
        "lineNumber": 12,
        "symbolKey": "...",
        "projectName": "MyApp",
        "accessibility": "Public"
      }
    ]
  },
  "error": null
}

Search methods containing "Login"

Request
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "search_symbols",
    "arguments": {
      "query": "*Login*",
      "kinds": "Method"
    }
  }
}
Response
{
  "success": true,
  "data": {
    "query": "*Service",
    "matchCount": 2,
    "paging": {
      "skip": 0,
      "take": 200,
      "returned": 2,
      "total": 2
    },
    "matches": [
      {
        "name": "UserService",
        "fullName": "MyApp.Services.UserService",
        "kind": "Type",
        "containingType": null,
        "namespace": "MyApp.Services",
        "filePath": "/path/to/UserService.cs",
        "lineNumber": 12,
        "symbolKey": "...",
        "projectName": "MyApp",
        "accessibility": "Public"
      }
    ]
  },
  "error": null
}

Search public types only

Request
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "search_symbols",
    "arguments": {
      "query": "*Manager",
      "kinds": "Type",
      "accessibility": "Public"
    }
  }
}
Response
{
  "success": true,
  "data": {
    "query": "*Service",
    "matchCount": 2,
    "paging": {
      "skip": 0,
      "take": 200,
      "returned": 2,
      "total": 2
    },
    "matches": [
      {
        "name": "UserService",
        "fullName": "MyApp.Services.UserService",
        "kind": "Type",
        "containingType": null,
        "namespace": "MyApp.Services",
        "filePath": "/path/to/UserService.cs",
        "lineNumber": 12,
        "symbolKey": "...",
        "projectName": "MyApp",
        "accessibility": "Public"
      }
    ]
  },
  "error": null
}

Include external assemblies

Request
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "search_symbols",
    "arguments": {
      "query": "Task",
      "kinds": "Type",
      "sourceOnly": false
    }
  }
}
Response
{
  "success": true,
  "data": {
    "query": "*Service",
    "matchCount": 2,
    "paging": {
      "skip": 0,
      "take": 200,
      "returned": 2,
      "total": 2
    },
    "matches": [
      {
        "name": "UserService",
        "fullName": "MyApp.Services.UserService",
        "kind": "Type",
        "containingType": null,
        "namespace": "MyApp.Services",
        "filePath": "/path/to/UserService.cs",
        "lineNumber": 12,
        "symbolKey": "...",
        "projectName": "MyApp",
        "accessibility": "Public"
      }
    ]
  },
  "error": null
}

Response Notes

Returns matching symbols (with paging) including stable symbol keys