Skip to content

Bound and paginate list_directory MCP results #1048

Description

@phernandez

Problem

list_directory currently returns every matching directory and file row. Large projects can produce oversized MCP responses even when hosted Cloud decorations are capped.

Discovered while reviewing basicmachines-co/basic-memory-cloud#1470. Cloud now caps its added private note-link rows, but the core tool result remains unbounded.

Proposed change

  • Add bounded pagination or an explicit validated limit to list_directory.
  • Keep the default response small enough for agent tool use.
  • Include continuation guidance or pagination metadata when more rows exist.
  • Cover text and structured output, recursive depth, glob filtering, and stable ordering.

This changes the MCP tool surface/behavior, so ship it through the Basic Memory release and ChatGPT app review path rather than folding it into the Cloud trial-funnel hotfix.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions