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

Tool for regex content search across files. More...

Inheritance diagram for entropic::GrepTool:
Collaboration diagram for entropic::GrepTool:

Public Member Functions

 GrepTool (FilesystemServer &server, const std::string &data_dir)
 Construct from data directory.
 
MCPAccessLevel required_access_level () const override
 Read-only tool — requires READ access.
 
ServerResponse execute (const std::string &args_json) override
 Search files for regex pattern matches.
 
- 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 regex content search across files.

@dg_internal

Version
1.8.5

Definition at line 1712 of file filesystem.cpp.

Constructor & Destructor Documentation

◆ GrepTool()

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

Construct from data directory.

Parameters
data_dirPath to bundled data directory. @dg_internal
Version
2.1.4

Definition at line 1720 of file filesystem.cpp.

Member Function Documentation

◆ execute()

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

Search files for regex pattern matches.

Execute grep: compile, then search one file or walk a tree.

Parameters
args_jsonJSON with "pattern" and optional "glob" keys.
Returns
ServerResponse with match results. @dg_internal
Version
1.8.5

v2.14.0 (gh#173/#202/#203): declared envelope {matches, truncated, reason?, next_offset?}; limit/offset page past what used to be a silent 100-match cap; path aims at one file or directory; binary files are skipped.

Parameters
args_jsonJSON with "pattern" and optional "glob" (default "*"), "path", "limit" (default 100), "offset".
Returns
A ServerResponse whose result is the declared success object, or invalid_regex, not_found (no such path) or invalid_args. @req REQ-MCP-022 @req REQ-MCP-021
Version
2.14.0

Implements entropic::ToolBase.

Definition at line 1881 of file filesystem.cpp.

◆ required_access_level()

MCPAccessLevel entropic::GrepTool::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 1733 of file filesystem.cpp.


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