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

Tool for executing shell commands. More...

Inheritance diagram for entropic::ExecuteTool:
Collaboration diagram for entropic::ExecuteTool:

Public Member Functions

 ExecuteTool (ToolDefinition def, BashServer &server)
 Construct from tool definition with server ref.
 
ServerResponse execute (const std::string &args_json) override
 Execute a shell command.
 
- 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.
 
virtual std::string anchor_key (const std::string &args_json) const
 Generate anchor key for this tool result.
 
virtual MCPAccessLevel required_access_level () const
 Minimum access level required to execute this tool.
 

Additional Inherited Members

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

Detailed Description

Tool for executing shell commands.

@dg_internal

Version
1.8.5

Definition at line 91 of file bash.cpp.

Constructor & Destructor Documentation

◆ ExecuteTool()

entropic::ExecuteTool::ExecuteTool ( ToolDefinition  def,
BashServer server 
)
inline

Construct from tool definition with server ref.

Parameters
defTool definition loaded from JSON.
serverOwning BashServer reference. @dg_internal
Version
1.8.5

Definition at line 100 of file bash.cpp.

Member Function Documentation

◆ execute()

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

Execute a shell command.

Parameters
args_jsonJSON with "command" and optional "working_dir".
Returns
ServerResponse with stdout/stderr or error. @dg_internal
Version
1.8.5

Operator approval is the gate.

Security model: the engine's tool-call approval flow gates whether this method runs at all. There is no command-content allowlist or denylist here; the operator approves a specific command value shown in the prompt, and that's what runs. The only validation we do is on working_dir, because that field is concatenated into a shell cd clause and could smuggle commands the operator never saw.

Parameters
args_jsonJSON with "command" and optional "working_dir" (defaulting to the server's own working directory).
Returns
A ServerResponse with no directives whose result is either a JSON object carrying the process exit_code and combined stdout+stderr output, or the working_dir rejection error when the cwd failed validation — in which case no shell ran. @req REQ-MCP-023
Version
2.1.1-rc1

Implements entropic::ToolBase.

Definition at line 136 of file bash.cpp.


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