Browse documentation

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

NameTypeRequiredDescription
querystringYesName, identifier, symbol query, file path, or literal text depending on intent.
intentstringNoRouting mode: 'auto' (default), 'symbol', 'references', 'implementations', 'callers', 'hierarchy', 'fileOutline', or 'literalText'. Default: "auto"
scopejsonNoOptional 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.
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.
pathStylestringNoPath style: 'absolute' (default) or 'relative' (to solution root). Default: "absolute"
skipnumberNoPagination offset for candidate/result pages. Default is 0. Default: 0
takenumberNoPagination size. Default is 50. Default: 50
responseDetailstringNocompact 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

Arguments
{
  "query": "OrderService",
  "intent": "auto",
  "kinds": "Type"
}
Full MCP request
Full MCP request
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "find_code",
    "arguments": {
      "query": "OrderService",
      "intent": "auto",
      "kinds": "Type"
    }
  }
}
Illustrative response
{
  "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

Arguments
{
  "query": "Task",
  "intent": "symbol",
  "kinds": "Type",
  "scope": {
    "mode": "solution",
    "includeExternal": true
  }
}
Full MCP request
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

Arguments
{
  "query": "IOrderRepository",
  "intent": "references",
  "kinds": "Type"
}
Full MCP request
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

Arguments
{
  "query": "Services/OrderService.cs",
  "intent": "fileOutline"
}
Full MCP request
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

Arguments
{
  "query": "Order could not be submitted.",
  "intent": "literalText"
}
Full MCP request
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.