Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Description ¶
Description honestly lists the sandbox environment AND the input contract so the agent writes correct calls on the first try (FR-016). The usage rules exist because LLMs repeatedly trip on two things: leading indentation on top-level statements and passing `stdin` as a parsed object instead of a string. Accidental top-level indentation is auto-corrected before execution (normalizeTopLevelIndent), but spelling the contract out still avoids needless confusion. Cheaper than a retry loop.
Types ¶
type ExecRequest ¶
type ExecRequest struct {
Code string `` /* 223-byte string literal not displayed */
TimeoutS int `json:"timeout_s,omitempty" jsonschema:"wall-clock timeout in seconds (default 30, clamped to [1,300])"`
Stdin string `` /* 143-byte string literal not displayed */
}
ExecRequest is the public input schema of the exec tool.
type ExecResult ¶
type ExecResult struct {
Stdout string `json:"stdout"`
Stderr string `json:"stderr"`
ExitCode int `json:"exit_code"`
DurationMS int64 `json:"duration_ms"`
Truncated bool `json:"truncated"`
TimedOut bool `json:"timed_out"`
}
ExecResult is the public output schema of the exec tool. The field set is a versioned contract (constitution III) and is identical across all transports.
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler implements the exec tool. Runs are serialized within the instance (constitution VIII): only one execution proceeds at a time.
func (*Handler) Handle ¶
func (h *Handler) Handle(ctx context.Context, _ *mcp.CallToolRequest, in ExecRequest) (*mcp.CallToolResult, ExecResult, error)
Handle is the MCP tool handler. Invalid input returns an error (tool-call error); a non-zero exit or a timeout is a successful result with the corresponding fields set.