Browse documentation

view_external_definition

[external]

Views bounded source or declarations for external symbols from referenced assemblies.

Namespace recovery requires Glider 12.4.5 or later.

Try it locally in the Glider playground

Parameters

NameTypeRequiredDescription
symbolNamestringYesSymbol to look up: a simple name, a fully qualified type, or Type.Member ('...JsonSerializer.Serialize'). For a member, omit the parameter list, return type, and method type arguments. A Type.Member name returns the containing type anchored at the member, including a non-public one. Namespace input returns type candidates. Use a returned symbolName unchanged, including generic metadata arity.
assemblyHintstringNoOptional assembly name hint. It orders the search when the same type name exists in several assemblies, and never excludes an assembly, so a wrong hint costs position and not the result.
projectNamestringNoOptional project name to limit referenced assemblies.
maxLinesnumberNoMaximum source lines per page. Default is 400. Use 0 to remove the line cap; the response character limit still applies. Default: 400
startLinenumberNoAbsolute one-based line for a later page. Use 0 to start near the member, or at line 1 for a type. Default is 0. Default: 0
startColumnnumberNoOne-based column within startLine. Use nextStartColumn when a long line spans pages. Default is 1. Default: 1
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.

View the first two lines of a framework type

Arguments
{
  "symbolName": "System.Text.Json.JsonSerializer",
  "assemblyHint": "System.Text.Json",
  "maxLines": 2
}
Full MCP request
Full MCP request
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "view_external_definition",
    "arguments": {
      "symbolName": "System.Text.Json.JsonSerializer",
      "assemblyHint": "System.Text.Json",
      "maxLines": 2
    }
  }
}
Illustrative response
{
  "success": true,
  "symbolName": "JsonSerializer",
  "symbolKind": "Class",
  "assemblyName": "System.Text.Json",
  "assemblyVersion": "9.0.0.0",
  "referenceAssemblyName": null,
  "referenceAssemblyVersion": null,
  "assemblyHintMatched": true,
  "sourceOrigin": "Decompiled",
  "sourceCodeKind": "Implementation",
  "sourceUrl": null,
  "sourceCode": "public static class JsonSerializer\n{",
  "maxLines": 2,
  "sourceCodeTotalLines": 1200,
  "sourceCodeReturnedLines": 2,
  "sourceCodeStartLine": 1,
  "sourceCodeStartColumn": 1,
  "sourceCodeTruncated": true,
  "nextStartLine": 3,
  "nextStartColumn": 1,
  "language": "C#"
}

Continue at the coordinates from the previous page

Arguments
{
  "symbolName": "System.Text.Json.JsonSerializer",
  "assemblyHint": "System.Text.Json",
  "maxLines": 2,
  "startLine": 3,
  "startColumn": 1
}
Full MCP request
Full MCP request
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "view_external_definition",
    "arguments": {
      "symbolName": "System.Text.Json.JsonSerializer",
      "assemblyHint": "System.Text.Json",
      "maxLines": 2,
      "startLine": 3,
      "startColumn": 1
    }
  }
}

Response Notes

Returns a page of external source with assembly information. For source code, assemblyName and assemblyVersion identify the source assembly. referenceAssemblyName and referenceAssemblyVersion identify the compilation reference when it differs. assemblyHintMatched checks that compilation reference, not the source assembly. A hint orders matches but does not exclude them. sourceOrigin identifies SourceLink, Decompiled, or Metadata. Metadata means decompilation found no source; sourceCode is empty and sourceCodeNote explains the gap. sourceCodeKind distinguishes Source, Implementation, and DeclarationOnly. DeclarationOnly can contain stub bodies; sourceCodeNote warns against treating them as executable code. For a member, memberAnchorStatus is Unique, Ambiguous, or Unavailable. lineNumber appears only for a unique direct-member match. memberDeclarationLines gives the absolute lines of direct matches; multiple lines do not select an overload. sourceCodeStartLine and sourceCodeStartColumn identify the first returned character. If nextStartLine and nextStartColumn appear, pass both values to read the next page. maxLines=0 removes only the line cap. The response character limit still applies. A non-public member can resolve with a Type.Member name. A plain type name that no referenced assembly declares misses. An internal type can resolve with its full type name, including CLR generic arity and nested-type names. A Type.Member miss can mean the selector or project references differ, the member is absent, or a reference assembly lacks the member. From Glider 12.4.5, exact namespace input returns success:false with namespaceName, up to ten candidates, and candidatesOmitted. Each candidate provides symbolName, assemblyName, assemblyVersion, and assemblyIdentity. Retry with its symbolName and assemblyName as assemblyHint. The hint prioritizes matching assembly names; it does not guarantee unique assembly selection. Verify referenceAssemblyName, or assemblyName when the reference name is absent. Candidates name accessible types declared directly in that namespace within the selected projects. The response preserves names shared by different assemblies. A parent with only child namespaces can return an empty list. candidatesOmitted is true when additional eligible candidates exceed the type cap or the response character limit. Narrow projectName or provide a specific full type name when candidates are omitted. Results use top-level fields with success. Compact is the default; full adds responseDiagnostics. Both modes retain errors, coverage, partial state, and recovery advice.