find_code
[symbols]
Discover C# symbol keys or a file outline. Use search_text for literal text or regex.
Available in Glider 13.0.0. Check that the installed find_code schema advertises matchMode.
Before you use this tool
Only symbol and fileOutline are supported. Pass a selected symbolKey to direct relationship tools. fileOutline rejects symbol filters, sorting, matchMode=all, and external scope. Use get_structure for a known file and outline filters.
Try it locally in the Glider playground
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| query | string | Yes | Required query, not name. Symbol name, qualified name, or fragment. * and ? match whole names. fileOutline accepts an exact path, loaded C# filename, or symbol name. File globs and regex are unsupported. |
| intent | string | No | symbol discovers symbol keys. fileOutline selects a file outline. Default: "symbol" |
| scope | json | No | Optional scope. Omit scope to search the solution. When supplied, set mode to solution, project, document, or pathPrefix. project requires projectName. document requires filePath. pathPrefix requires pathPrefix. Paths can be absolute or relative to solutionRoot. Set includeExternal to true when the tool supports external symbols. |
| kinds | string | No | Optional CSV string, not an array. Kinds: Type, Class, Interface, Struct, Enum, Delegate, Method, Property, Field, Event, Namespace. Type selects every named type. Applies to symbol only. |
| matchMode | string | No | Only closest or all. closest selects the first nonempty exact, prefix, or substring tier after scope and filters. all retains broad matches. Default: "closest" |
| namespaceFilter | string | No | Optional namespace prefix or glob. Applies to symbol only. |
| accessibility | string | No | Optional accessibility: Public, Internal, Private, Protected, ProtectedOrInternal, ProtectedAndInternal. Applies to symbol only. |
| sortBy | string | No | Optional sort field: name, kind, filePath, projectName, namespace. Applies to symbol only. |
| sortOrder | string | No | Sort order: asc, ascending, desc, descending. Applies to symbol only. Default: "asc" |
| pathStyle | string | No | absolute or relative to solutionRoot. Default: "absolute" |
| skip | number | No | Result offset after filters and sort. Default: 0 |
| take | number | No | Maximum results in this page. Default: 50 |
| responseDetail | string | No | compact returns results and actionable state. full adds diagnostic metadata under responseDiagnostics. Default: "compact" |
Examples
Replace sample paths and symbol keys with values from your workspace.
Discover a type
{
"query": "OrderService",
"kinds": "Type"
}Full MCP request
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "find_code",
"arguments": {
"query": "OrderService",
"kinds": "Type"
}
}
}{
"success": true,
"query": "OrderService",
"intent": "symbol",
"matchMode": "closest",
"candidateCount": 1,
"matchTier": "Exact",
"suppressedMatches": 2,
"suppressedMatchesIsFloor": false,
"coverage": {
"complete": true,
"scope": "loadedProjects",
"skippedProjects": []
},
"disambiguationRequired": false,
"paging": {
"total": 1
},
"candidates": [
{
"symbolKey": "...",
"name": "OrderService",
"fullName": "Acme.Orders.OrderService",
"kind": "Class",
"filePath": "/path/to/OrderService.cs",
"lineNumber": 12,
"projectName": "Orders.Api"
}
]
}Explore public service types
{
"query": "Service",
"matchMode": "all",
"kinds": "Type",
"namespaceFilter": "Acme.Orders",
"accessibility": "Public",
"sortBy": "name"
}Full MCP request
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "find_code",
"arguments": {
"query": "Service",
"matchMode": "all",
"kinds": "Type",
"namespaceFilter": "Acme.Orders",
"accessibility": "Public",
"sortBy": "name"
}
}
}Search referenced assemblies explicitly
{
"query": "Task",
"kinds": "Type",
"scope": {
"mode": "solution",
"includeExternal": true
}
}Full MCP request
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "find_code",
"arguments": {
"query": "Task",
"kinds": "Type",
"scope": {
"mode": "solution",
"includeExternal": true
}
}
}
}Outline a loaded C# file
{
"query": "OrderService.cs",
"intent": "fileOutline"
}Full MCP request
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "find_code",
"arguments": {
"query": "OrderService.cs",
"intent": "fileOutline"
}
}
}Response Notes
Unreleased builds remove the duplicate result.hints field. This breaking result change requires clients to read root hints. Hints are optional guidance. Returns candidates with opaque symbolKey values, coverage, and paging. closest reports matchTier and suppressedMatches; all retains every eligible name match. Wildcards form one Glob tier. Filters apply before tier selection; sorting and paging follow it. A page is not the complete match set. Continue with paging.nextSkip, including pages limited by the response budget. Zero matches are a valid empty answer. Source-only searches stay source-only, including empty results. Set scope.includeExternal=true explicitly; scope.mode is required when scope is supplied. Use solution or project scope for external symbols. Inspect coverage.complete and skippedProjects before claiming absence. Pass the selected key unchanged to get_source, get_symbol_info, or a direct relationship tool. Rediscover constructor keys after updating to this contract. Use view_external_definition for external definitions. For fileOutline, duplicate loaded filenames return candidate paths. Select one full path. A linked file can require scope.mode=project and scope.projectName. Duplicate project names require an exact path or a single-project load. Earlier servers retain their advertised find_code intents and separate search_symbols/resolve_symbol tools; follow that installed schema. Results use top-level fields with success. Compact is the default; full adds responseDiagnostics. Both modes retain errors, coverage, partial state, and recovery advice.