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.

Try this tool in 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'.
scopejsonNoOptional scope object. Supports Glider search-scope shapes such as project or file scoping.
kindsstringNoOptional symbol kind filter for symbol routing, for example 'Type,Method,Property'.
pathStylestringNoPath style: 'absolute' (default) or 'relative' (to solution root).
skipnumberNoPagination offset for candidate/result pages. Default is 0.
takenumberNoPagination size. Default is 50.

Examples

Start with semantic discovery for a type name

Request
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "find_code",
    "arguments": {
      "query": "SolutionManager",
      "intent": "auto",
      "kinds": "Type"
    }
  }
}
Response
{
  "success": true,
  "data": {
    "query": "SolutionManager",
    "intent": "symbol",
    "routedTool": "search_symbols",
    "candidateCount": 2,
    "candidates": [
      {
        "symbolKey": "...",
        "name": "SolutionManager",
        "fullName": "Glider.Services.SolutionManager",
        "kind": "Type",
        "filePath": "/path/to/SolutionManager.cs",
        "lineNumber": 12,
        "projectName": "Glider"
      }
    ],
    "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"
      ]
    }
  },
  "meta": {
    "durationMs": 123,
    "cancelled": false,
    "timedOut": false,
    "timeoutMs": 1200000
  },
  "error": null
}

Route to references for a known symbol name

Request
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "find_code",
    "arguments": {
      "query": "ISolutionManager",
      "intent": "references",
      "kinds": "Type"
    }
  }
}
Response
{
  "success": true,
  "data": {
    "query": "SolutionManager",
    "intent": "symbol",
    "routedTool": "search_symbols",
    "candidateCount": 2,
    "candidates": [
      {
        "symbolKey": "...",
        "name": "SolutionManager",
        "fullName": "Glider.Services.SolutionManager",
        "kind": "Type",
        "filePath": "/path/to/SolutionManager.cs",
        "lineNumber": 12,
        "projectName": "Glider"
      }
    ],
    "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"
      ]
    }
  },
  "meta": {
    "durationMs": 123,
    "cancelled": false,
    "timedOut": false,
    "timeoutMs": 1200000
  },
  "error": null
}

Get a compact outline for a C# file

Request
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "find_code",
    "arguments": {
      "query": "Glider.Server/Tools/CodeFinderTools.cs",
      "intent": "fileOutline"
    }
  }
}
Response
{
  "success": true,
  "data": {
    "query": "SolutionManager",
    "intent": "symbol",
    "routedTool": "search_symbols",
    "candidateCount": 2,
    "candidates": [
      {
        "symbolKey": "...",
        "name": "SolutionManager",
        "fullName": "Glider.Services.SolutionManager",
        "kind": "Type",
        "filePath": "/path/to/SolutionManager.cs",
        "lineNumber": 12,
        "projectName": "Glider"
      }
    ],
    "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"
      ]
    }
  },
  "meta": {
    "durationMs": 123,
    "cancelled": false,
    "timedOut": false,
    "timeoutMs": 1200000
  },
  "error": null
}

Use literal text search for non-symbol text

Request
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "find_code",
    "arguments": {
      "query": "No solution loaded. Use load first.",
      "intent": "literalText"
    }
  }
}
Response
{
  "success": true,
  "data": {
    "query": "SolutionManager",
    "intent": "symbol",
    "routedTool": "search_symbols",
    "candidateCount": 2,
    "candidates": [
      {
        "symbolKey": "...",
        "name": "SolutionManager",
        "fullName": "Glider.Services.SolutionManager",
        "kind": "Type",
        "filePath": "/path/to/SolutionManager.cs",
        "lineNumber": 12,
        "projectName": "Glider"
      }
    ],
    "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"
      ]
    }
  },
  "meta": {
    "durationMs": 123,
    "cancelled": false,
    "timedOut": false,
    "timeoutMs": 1200000
  },
  "error": null
}

Response Notes

Returns symbol candidates, disambiguation candidates, or the wrapped result from the routed downstream tool. Zero symbol matches return success=false for symbol-routed intents.