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.

Why this tool exists

C# names are overloaded, scoped, generic, nested, and sometimes duplicated across projects.

How it helps the agent

Symbol discovery converts fuzzy names or cursor positions into stable identities the model can reuse for later references, callers, and refactors.

Try it locally in the Glider playground

Parameters

NameTypeRequiredDescription
querystringYesSearch pattern. Supports '*' and '?', or plain text for substring match.
kindsstringNoOptional 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.
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.

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,
      "hasMore": false,
      "truncatedForSize": false,
      "nextSkip": null
    },
    "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,
      "hasMore": false,
      "truncatedForSize": false,
      "nextSkip": null
    },
    "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,
      "hasMore": false,
      "truncatedForSize": false,
      "nextSkip": null
    },
    "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,
      "hasMore": false,
      "truncatedForSize": false,
      "nextSkip": null
    },
    "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. The page is also bounded by the server response limit. paging.truncatedForSize reports a page cut short to fit. Continue from paging.nextSkip rather than skip + take, which would step over the trimmed items. Zero matches is a valid empty answer, with success=true and matchCount 0. It replaces the standing nextSteps, which describe what to do with a symbolKey it does not carry. When a referenced assembly declares the name, the answer reports that assembly under externalAssembly.

↑/↓ NavigateEnter OpenSpace Expand