[solution]
Gets a compact C# file outline under the loaded root with optional container selection, kind filtering, and paging. Use get_file_contents when you need raw text.
Try this tool in Playground.
| Name | Type | Required | Description |
|---|---|---|---|
| filePath | string | Yes | File path to inspect. Can be absolute or relative to the loaded root. |
| containerQualifiedName | string | No | Optional namespace or type container inside the file. Simple names work only when unique in that file. |
| includeMembers | boolean | No | If true, include member declarations. Selecting a container also expands its members. Default is false. |
| includeNestedTypes | boolean | No | If true, include nested type declarations. Default is true. |
| kinds | string | No | Optional kind filter, comma-separated. Example: 'Class,Method,Property'. |
| pathStyle | string | No | Path style: 'absolute' (default) or 'relative' (to solution root). |
| skip | number | No | Results to skip for paging. Default is 0. |
| take | number | No | Results to return for paging. Default is 200. |
Inspect a file outline
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "get_structure",
"arguments": {
"filePath": "/Users/dev/MyProject/Widget.cs"
}
}
}{
"success": true,
"data": {
"filePath": "/Users/dev/MyProject/Widget.cs",
"language": "csharp",
"inWorkspace": true,
"totalLines": 42,
"containerQualifiedName": null,
"summary": {
"topLevelTypeCount": 2,
"memberCount": 0,
"kindCounts": {
"Namespace": 1,
"Class": 1,
"Interface": 1
}
},
"paging": {
"skip": 0,
"take": 200,
"total": 3,
"returned": 3,
"hasMore": false
},
"items": [
{
"kind": "Namespace",
"name": "MyProject.Features",
"qualifiedName": "MyProject.Features",
"containerQualifiedName": null,
"accessibility": null,
"modifiers": [],
"header": "namespace MyProject.Features",
"startLine": 1,
"endLine": 20,
"lineCount": 20,
"childCount": 2
},
{
"kind": "Class",
"name": "Widget",
"qualifiedName": "MyProject.Features.Widget",
"containerQualifiedName": "MyProject.Features",
"accessibility": "public",
"modifiers": [
"sealed"
],
"header": "public sealed class Widget",
"startLine": 3,
"endLine": 15,
"lineCount": 13,
"childCount": 0
}
],
"hints": {
"nextSteps": [
"Use get_file_contents when you need exact source text for specific lines",
"Use get_type_info after choosing a type when you need semantic type/member details",
"Set includeMembers=true or select containerQualifiedName to expand members"
]
}
},
"meta": {
"durationMs": 94,
"cancelled": false,
"timedOut": false,
"timeoutMs": 1200000
},
"error": null
}Expand one selected container and its members
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "get_structure",
"arguments": {
"filePath": "src/Widget.cs",
"containerQualifiedName": "MyProject.Features.Widget",
"includeMembers": true,
"pathStyle": "relative"
}
}
}{
"success": true,
"data": {
"filePath": "/Users/dev/MyProject/Widget.cs",
"language": "csharp",
"inWorkspace": true,
"totalLines": 42,
"containerQualifiedName": null,
"summary": {
"topLevelTypeCount": 2,
"memberCount": 0,
"kindCounts": {
"Namespace": 1,
"Class": 1,
"Interface": 1
}
},
"paging": {
"skip": 0,
"take": 200,
"total": 3,
"returned": 3,
"hasMore": false
},
"items": [
{
"kind": "Namespace",
"name": "MyProject.Features",
"qualifiedName": "MyProject.Features",
"containerQualifiedName": null,
"accessibility": null,
"modifiers": [],
"header": "namespace MyProject.Features",
"startLine": 1,
"endLine": 20,
"lineCount": 20,
"childCount": 2
},
{
"kind": "Class",
"name": "Widget",
"qualifiedName": "MyProject.Features.Widget",
"containerQualifiedName": "MyProject.Features",
"accessibility": "public",
"modifiers": [
"sealed"
],
"header": "public sealed class Widget",
"startLine": 3,
"endLine": 15,
"lineCount": 13,
"childCount": 0
}
],
"hints": {
"nextSteps": [
"Use get_file_contents when you need exact source text for specific lines",
"Use get_type_info after choosing a type when you need semantic type/member details",
"Set includeMembers=true or select containerQualifiedName to expand members"
]
}
},
"meta": {
"durationMs": 94,
"cancelled": false,
"timedOut": false,
"timeoutMs": 1200000
},
"error": null
}Filter visible kinds and page the outline
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "get_structure",
"arguments": {
"filePath": "src/Widget.cs",
"containerQualifiedName": "Widget",
"kinds": "Method,Property,Constructor",
"skip": 0,
"take": 25,
"pathStyle": "relative"
}
}
}{
"success": true,
"data": {
"filePath": "/Users/dev/MyProject/Widget.cs",
"language": "csharp",
"inWorkspace": true,
"totalLines": 42,
"containerQualifiedName": null,
"summary": {
"topLevelTypeCount": 2,
"memberCount": 0,
"kindCounts": {
"Namespace": 1,
"Class": 1,
"Interface": 1
}
},
"paging": {
"skip": 0,
"take": 200,
"total": 3,
"returned": 3,
"hasMore": false
},
"items": [
{
"kind": "Namespace",
"name": "MyProject.Features",
"qualifiedName": "MyProject.Features",
"containerQualifiedName": null,
"accessibility": null,
"modifiers": [],
"header": "namespace MyProject.Features",
"startLine": 1,
"endLine": 20,
"lineCount": 20,
"childCount": 2
},
{
"kind": "Class",
"name": "Widget",
"qualifiedName": "MyProject.Features.Widget",
"containerQualifiedName": "MyProject.Features",
"accessibility": "public",
"modifiers": [
"sealed"
],
"header": "public sealed class Widget",
"startLine": 3,
"endLine": 15,
"lineCount": 13,
"childCount": 0
}
],
"hints": {
"nextSteps": [
"Use get_file_contents when you need exact source text for specific lines",
"Use get_type_info after choosing a type when you need semantic type/member details",
"Set includeMembers=true or select containerQualifiedName to expand members"
]
}
},
"meta": {
"durationMs": 94,
"cancelled": false,
"timedOut": false,
"timeoutMs": 1200000
},
"error": null
}Returns a paged C# outline with per-kind counts, compact declaration headers, and next-step hints for deeper reads.