List top-level symbols in a Swift file
swiftGetSymbolsOverviewRetrieve top-level symbols (classes, structs, enums, protocols, functions) from a Swift file to quickly orient yourself after navigating to a new file.
Instructions
[mg.code] Cheap orientation: returns the top-level symbols (classes, structs, enums, protocols, free functions) declared in a Swift file via SourceKit-LSP's documentSymbol. Set topLevelOnly: false for nested children too. Useful right after swiftGetSymbolDefinition lands you in a new file.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"filePath": "<filePath>"
},
"name": "swiftGetSymbolsOverview"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filePath | Yes | Absolute path to a Swift source file. | |
| projectRoot | No | ||
| topLevelOnly | No | Return only top-level symbols (classes, structs, enums, protocols, free functions). When false, returns nested children too. Default true keeps responses small. |