Skip to content

Feature request: support directory paths in get_symbols_overview for batch retrieval #1412

@Serg2000Mr

Description

@Serg2000Mr

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:

  1. Call find_file or list the directory contents some other way.
  2. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions