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.

Why this tool exists

Agents often know the intent of a navigation task before they know the exact lower-level tool to call.

How it helps the agent

It acts as the semantic front door: the model can ask for code by meaning, then let Glider route to symbols, references, implementations, callers, hierarchy, or text search.

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'.
scopejsonNoOptional scope object. Supports project or file scoping.
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).
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": "OrderService",
      "intent": "auto",
      "kinds": "Type"
    }
  }
}
Response
{
  "success": true,
  "data": {
    "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"
      ]
    }
  },
  "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": "IOrderRepository",
      "intent": "references",
      "kinds": "Type"
    }
  }
}
Response
{
  "success": true,
  "data": {
    "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"
      ]
    }
  },
  "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": "Services/OrderService.cs",
      "intent": "fileOutline"
    }
  }
}
Response
{
  "success": true,
  "data": {
    "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"
      ]
    }
  },
  "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": "Order could not be submitted.",
      "intent": "literalText"
    }
  }
}
Response
{
  "success": true,
  "data": {
    "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"
      ]
    }
  },
  "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. 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 there are a valid empty answer, with success=true and candidateCount 0. An empty answer 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 and points at view_external_definition.

↑/↓ NavigateEnter OpenSpace Expand