find_code
[symbols]
Recommended first-call router for code navigation. Starts with semantic symbol discovery by default, then routes to references, implementations, callers, hierarchy, file outline, or literal text search.
Before you use this tool
The development fileOutline route returns the same semantic keys and workspace snapshot as get_structure. Select linked-file context with scope.projectName.
Try it locally in the Glider playground
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| query | string | Yes | Name, identifier, symbol query, file path, or literal text depending on intent. |
| intent | string | No | Routing mode: 'auto' (default), 'symbol', 'references', 'implementations', 'callers', 'hierarchy', 'fileOutline', or 'literalText'. Default: "auto" |
| 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 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. |
| pathStyle | string | No | Path style: 'absolute' (default) or 'relative' (to solution root). Default: "absolute" |
| skip | number | No | Pagination offset for candidate/result pages. Default is 0. Default: 0 |
| take | number | No | Pagination size. Default is 50. 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.
Start with semantic discovery for a type name
{
"query": "OrderService",
"intent": "auto",
"kinds": "Type"
}Full MCP request
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "find_code",
"arguments": {
"query": "OrderService",
"intent": "auto",
"kinds": "Type"
}
}
}{
"success": true,
"query": "OrderService",
"intent": "symbol",
"routedTool": "search_symbols",
"candidateCount": 2,
"candidates": [
{
"symbolKey": "...",
"name": "OrderService",
"fullName": "Acme.Orders.Services.OrderService",
"kind": "Type",
"filePath": "/path/to/OrderService.cs",
"lineNumber": 12,
"projectName": "Orders.Api"
}
],
"hints": {
"nextSteps": [
"Use a returned symbolKey with find_references, find_implementations, find_callers, or get_type_hierarchy",
"Use intent=literalText only for comments, strings, config-like text, or non-symbol text"
]
}
}Search referenced assemblies explicitly
{
"query": "Task",
"intent": "symbol",
"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",
"intent": "symbol",
"kinds": "Type",
"scope": {
"mode": "solution",
"includeExternal": true
}
}
}
}Route to references for a known symbol name
{
"query": "IOrderRepository",
"intent": "references",
"kinds": "Type"
}Full MCP request
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "find_code",
"arguments": {
"query": "IOrderRepository",
"intent": "references",
"kinds": "Type"
}
}
}Get a compact outline for a C# file
{
"query": "Services/OrderService.cs",
"intent": "fileOutline"
}Full MCP request
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "find_code",
"arguments": {
"query": "Services/OrderService.cs",
"intent": "fileOutline"
}
}
}Use literal text search for non-symbol text
{
"query": "Order could not be submitted.",
"intent": "literalText"
}Full MCP request
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "find_code",
"arguments": {
"query": "Order could not be submitted.",
"intent": "literalText"
}
}
}Response Notes
Returns symbol candidates, disambiguation candidates, or the wrapped result from the routed downstream tool. The intents that resolve one symbol are references, implementations, callers, and hierarchy. They return success=false when nothing resolves. Otherwise they return candidates from a single name-match tier: exact name, else name prefix, else substring. matchTier names the tier. suppressedMatches counts what a weaker tier held. Add * or ? to match loosely on purpose. intent=symbol and the default auto symbol route call search_symbols. That route stays a broad search and reports no tier. Zero matches are a valid empty answer, with success=true and candidateCount 0. Source-only searches stay source-only, including empty results. Use intent=symbol and scope.includeExternal=true to search referenced assemblies explicitly. scope.mode is required: use solution, or project with projectName. Empty results provide complete retry arguments. Retain query, kinds, and the project filter when appropriate. Use solution or project scope because external symbols have no source document. Empty pages provide guidance without requiring a returned symbolKey. Results use top-level fields with success. Compact is the default; full adds responseDiagnostics. Both modes retain errors, coverage, partial state, and recovery advice.