|
Entropic 2.14.3
Local-first agentic inference engine
|
Tool for reading file contents with line numbering. More...


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 ToolDefinition & | definition () const |
| Get the full tool definition. | |
Additional Inherited Members | |
Protected Attributes inherited from entropic::ToolBase | |
| ToolDefinition | definition_ |
| Tool definition. | |
Tool for reading file contents with line numbering.
@dg_internal
Definition at line 1305 of file filesystem.cpp.
|
inline |
Construct from server reference and data directory.
| server | Owning filesystem server. |
| data_dir | Path to bundled data directory. @dg_internal |
Definition at line 1314 of file filesystem.cpp.
|
inlineoverridevirtual |
Anchor key for context deduplication.
A non-empty key is what makes MCPServerBase auto-inject the context_anchor directive for this tool.
| args_json | JSON with "path" key. |
Reimplemented from entropic::ToolBase.
Definition at line 1353 of file filesystem.cpp.
|
overridevirtual |
Read a file and return numbered lines as JSON.
Execute read_file: resolve, gate, read a numbered window, track.
| args_json | JSON with "path" key. |
A successful read records the read in the FileAccessTracker — which is why read_file must always execute and opts out of duplicate detection. A partial (windowed) read counts as a read for read-before-write.
v2.13.0: resolved as a READ for the outside-root policy; gh#158: the read is recorded for the calling session only. v2.14.0 (gh#201): every line carries its number, and long files are paged.
| args_json | JSON with "path" and optional "offset"/"limit". |
Implements entropic::ToolBase.
Definition at line 1477 of file filesystem.cpp.
|
inlineoverridevirtual |
Read-only tool — requires READ access.
Reimplemented from entropic::ToolBase.
Definition at line 1328 of file filesystem.cpp.