Summary
get_symbols_overview currently accepts only file paths and returns ValueError: Expected a file path when called with a directory. Add support for directory inputs that returns top-level symbols for every file in the directory (recursively or one level deep).
Use case
When exploring a large codebase via Serena (e.g. understanding a C# module that spans 25+ files in one directory), an agent currently has to:
- Call
find_file or list the directory contents some other way.
- Loop over every
.cs file and call get_symbols_overview per file.
This is N round-trips and a lot of agent reasoning to do something the LSP server could batch on its own. For agents using Serena to write architecture overviews or plan changes touching a whole module, this is the most common navigation pattern, and the current per-file requirement is the slowest part.
Proposed behaviour
get_symbols_overview(relative_path="src/Core")
→ {
"src/Core/SessionMonitor.cs": [...top-level symbols...],
"src/Core/CpuSampler.cs": [...],
...
}
Optional flags worth considering:
recursive: bool = False — descend into subdirectories.
glob: str = None — filter files (e.g. "*.cs").
max_files: int = 100 — protect against accidental whole-repo dumps.
Workaround today
files = find_file("*.cs", relative_path="src/Core")
for f in files:
get_symbols_overview(relative_path=f)
Works, but in real agent runs this either burns turns or pushes the agent to fall back to Read for the whole file, which defeats the purpose of using Serena for symbolic navigation.
Notes
Summary
get_symbols_overviewcurrently accepts only file paths and returnsValueError: Expected a file pathwhen called with a directory. Add support for directory inputs that returns top-level symbols for every file in the directory (recursively or one level deep).Use case
When exploring a large codebase via Serena (e.g. understanding a C# module that spans 25+ files in one directory), an agent currently has to:
find_fileor list the directory contents some other way..csfile and callget_symbols_overviewper file.This is N round-trips and a lot of agent reasoning to do something the LSP server could batch on its own. For agents using Serena to write architecture overviews or plan changes touching a whole module, this is the most common navigation pattern, and the current per-file requirement is the slowest part.
Proposed behaviour
Optional flags worth considering:
recursive: bool = False— descend into subdirectories.glob: str = None— filter files (e.g."*.cs").max_files: int = 100— protect against accidental whole-repo dumps.Workaround today
Works, but in real agent runs this either burns turns or pushes the agent to fall back to
Readfor the whole file, which defeats the purpose of using Serena for symbolic navigation.Notes
documentSymbolis per-document, butworkspace/symbolexists. A directory variant could either iteratedocumentSymbolserver-side or useworkspace/symbolwith a path filter.get_symbols_overview directory/get_symbols_overview folder— no existing report. Issuesget_symbols_overviewandfind_symbolfail for files in dot-prefixed directories #1187, find_symbol fails on dot-directory files while get_symbols_overview succeeds #853, Allow symbol operations in dot-prefixed directories #1203 touched dot-prefixed path handling, which is unrelated.