Entropic 2.14.3
Local-first agentic inference engine
Loading...
Searching...
No Matches
entropic::ListDirectoryTool Class Reference

Tool for listing directory contents. More...

Inheritance diagram for entropic::ListDirectoryTool:
Collaboration diagram for entropic::ListDirectoryTool:

Public Member Functions

 ListDirectoryTool (FilesystemServer &server, const std::string &data_dir)
 Construct from server reference and data directory.
 
MCPAccessLevel required_access_level () const override
 Read-only tool — requires READ access.
 
ServerResponse execute (const std::string &args_json) override
 List directory entries with optional recursion.
 
- Public Member Functions inherited from entropic::ToolBase
 ToolBase (ToolDefinition def)
 Construct with a pre-built definition.
 
const std::string & name () const
 Get the tool name.
 
const ToolDefinition & definition () const
 Get the full tool definition.
 
virtual std::string anchor_key (const std::string &args_json) const
 Generate anchor key for this tool result.
 

Additional Inherited Members

- Protected Attributes inherited from entropic::ToolBase
ToolDefinition definition_
 Tool definition.
 

Detailed Description

Tool for listing directory contents.

@dg_internal

Version
1.8.5

Definition at line 1909 of file filesystem.cpp.

Constructor & Destructor Documentation

◆ ListDirectoryTool()

entropic::ListDirectoryTool::ListDirectoryTool ( FilesystemServer &  server,
const std::string &  data_dir 
)
inline

Construct from server reference and data directory.

Parameters
serverOwning filesystem server.
data_dirPath to bundled data directory. @dg_internal
Version
1.8.5

Definition at line 1918 of file filesystem.cpp.

Member Function Documentation

◆ execute()

ServerResponse entropic::ListDirectoryTool::execute ( const std::string &  args_json)
overridevirtual

List directory entries with optional recursion.

Execute list_directory: one page of a directory's entries.

Parameters
args_jsonJSON with "path" and optional depth params.
Returns
ServerResponse with directory listing. @dg_internal
Version
1.8.5

The optional parameters carry documented defaults (gh#116): path defaults to the project root, recursive to false, max_depth to 3. v2.13.0: resolved as a READ for the outside-root policy. v2.14.0 (gh#203): the declared {path, entries, truncated, ...} object instead of a bare array; recursive names are relative to the listed directory (they were bare file names, ambiguous across subdirectories).

Parameters
args_jsonJSON with optional "path", "recursive", "max_depth", "limit" (default 500) and "offset" — all may be omitted.
Returns
A ServerResponse whose result is the declared success object, or not_directory / invalid_args. @req REQ-MCP-021
Version
2.14.0

Implements entropic::ToolBase.

Definition at line 1987 of file filesystem.cpp.

◆ required_access_level()

MCPAccessLevel entropic::ListDirectoryTool::required_access_level ( ) const
inlineoverridevirtual

Read-only tool — requires READ access.

Returns
MCPAccessLevel::READ, relaxing ToolBase's WRITE default because this tool only inspects the workspace. @req REQ-MCP-011
Version
1.9.4

Reimplemented from entropic::ToolBase.

Definition at line 1932 of file filesystem.cpp.


The documentation for this class was generated from the following file: