Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@
*/
public class ShellExecuteTool {

/** Registered tool name (derived from the {@link #execute} method name). */
/**
* Registered tool name (derived from the {@link #execute} method name).
*/
public static final String NAME = "execute";

private final AbstractSandboxFilesystem sandbox;
Expand All @@ -37,19 +39,23 @@ public ShellExecuteTool(AbstractSandboxFilesystem sandbox) {

/**
* @param runtimeContext per-call agent runtime injected by the framework (not an LLM argument);
* may be {@code null} when no merged context is available
* may be {@code null} when no merged context is available
*/
@Tool(
description =
"Execute a shell command. Use for git, npm, build, test, and other terminal"
+ " operations. Returns combined output and exit code.")
+ " operations. Returns combined output and exit code. If a dedicated tool"
+ " exists (e.g., read_file, write_file), you MUST use it instead of shell"
+ " commands.")
public String execute(
RuntimeContext runtimeContext,
@ToolParam(name = "command", description = "Shell command to execute") String command,
@ToolParam(
name = "working_directory",
description =
"Working directory (relative to workspace root, optional)")
"Optional relative path from workspace root. Must not start"
+ " with /, ~, or ..(e.g., ., src).",
required = false)
String workingDirectory,
@ToolParam(name = "timeout", description = "Timeout in seconds (default: 30)")
int timeout) {
Expand Down
Loading