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

Tool for reading file contents with line numbering. More...

Inheritance diagram for entropic::ReadFileTool:
Collaboration diagram for entropic::ReadFileTool:

Public Member Functions

 ReadFileTool (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
 Read a file and return numbered lines as JSON.
 
std::string anchor_key (const std::string &args_json) const override
 Anchor key for context deduplication.
 
- 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 ToolDefinitiondefinition () const
 Get the full tool definition.
 

Additional Inherited Members

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

Detailed Description

Tool for reading file contents with line numbering.

Definition at line 761 of file filesystem.cpp.

Constructor & Destructor Documentation

◆ ReadFileTool()

entropic::ReadFileTool::ReadFileTool ( 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.

Definition at line 770 of file filesystem.cpp.

Member Function Documentation

◆ anchor_key()

std::string entropic::ReadFileTool::anchor_key ( const std::string &  args_json) const
inlineoverridevirtual

Anchor key for context deduplication.

Parameters
args_jsonJSON with "path" key.
Returns
"file:{path}" anchor key.

Reimplemented from entropic::ToolBase.

Definition at line 803 of file filesystem.cpp.

◆ execute()

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

Read a file and return numbered lines as JSON.

Execute read_file: resolve, gate, read, hash, track.

Parameters
args_jsonJSON with "path" key.
Returns
ServerResponse with file content or error.

Issue #15 (v2.1.4): pre-read gating moved into check_read_gates so the ignore-matcher refusal lives next to existence + size checks.

Implements entropic::ToolBase.

Definition at line 866 of file filesystem.cpp.

◆ required_access_level()

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

Read-only tool — requires READ access.

Returns
MCPAccessLevel::READ. @utility
Version
1.9.4

Reimplemented from entropic::ToolBase.

Definition at line 783 of file filesystem.cpp.


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