[external]
Views source code for external symbols (NuGet/framework), via SourceLink or decompilation.
Framework and package behavior often explains local code, but the source is outside the repo.
The model can inspect external definitions and package usage evidence instead of guessing from API names.
Try it locally in the Glider playground
| Name | Type | Required | Description |
|---|---|---|---|
| symbolName | string | Yes | Symbol name to look up (simple or fully qualified). |
| assemblyHint | string | No | Optional 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. |
| projectName | string | No | Optional project name to limit referenced assemblies. |
| maxLines | number | No | Maximum number of source lines to return. Use 0 for no limit. Default is 400. |
View JsonSerializer source
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "view_external_definition",
"arguments": {
"symbolName": "System.Text.Json.JsonSerializer",
"assemblyHint": "System.Text.Json"
}
}
}{
"success": true,
"data": {
"symbolName": "JsonSerializer",
"symbolKind": "Class",
"assemblyName": "System.Text.Json",
"assemblyVersion": "9.0.0.0",
"sourceOrigin": "SourceLink",
"sourceUrl": "https://raw.githubusercontent.com/...",
"sourceCode": "public static class JsonSerializer { ... }",
"sourceCodeTotalLines": 1200,
"sourceCodeReturnedLines": 400,
"sourceCodeTruncated": true,
"language": "C#"
},
"error": null
}Returns source code and assembly information. When an assemblyHint was given, assemblyHintMatched reports whether it named the assembly the symbol actually lives in, and assemblyHintNote explains a mismatch - namespaces and assembly names do not have to agree. A miss reports that the symbol is not in the public API surface of any referenced assembly: internal types are not visible through assembly metadata, so a symbol that decompiled source calls may exist and still not be readable.