Skip to content

Process Tools

Tools for interacting with the local process environment.

run_command

Spawn a process from the configured allowlist.

InputTypeRequiredDescription
commandstringyesBinary name (must be in allowedCommands)
argsstring[]noCommand arguments
cwdstringnoWorking directory (must be within scope)
envRecord<string, string>noAdditional environment variables
timeoutMsnumbernoOverride default timeout

Output: { stdout, stderr, exitCode, signal, timedOut }

Security: Runs with shell: false. Shell metacharacters in args are rejected. Output capped at 100KB per stream. Timeout triggers SIGTERM → SIGKILL escalation.


read_logs

Read the tail of a log file with optional filtering.

InputTypeRequiredDescription
pathstringyesPath to log file (must match logs.paths globs)
linesnumbernoNumber of lines from tail (default: logs.maxLines)
filterstringnoFilter pattern (literal or regex)
regexbooleannoTreat filter as regex (default: false)
jsonFieldstringnoExtract a field from JSON log lines (dot-notation)

Output: { lines: string[], total, filtered }


get_env

Read environment variables with automatic secret masking.

InputTypeRequiredDescription
sourcestringnoPath to .env file (default: process.env)
keysstring[]noSpecific keys to return
maskSecretsbooleannoMask sensitive values (default: true)

Output: { variables: Record<string, string>, masked: string[] }

Values matching secret patterns (SECRET, TOKEN, PASSWORD, KEY, API_KEY, PRIVATE, CREDENTIAL) are replaced with ***MASKED***.


list_processes

List running processes, optionally filtered by name or port.

InputTypeRequiredDescription
namestringnoFilter by process name (case-insensitive substring)
portnumbernoFilter by TCP listening port
limitnumbernoMax results (default: 50, max: 200)

Output: { processes: [{ pid, name, command, cpu?, memory?, port? }], total, filtered }

Useful for diagnosing port conflicts ("what's running on port 3000?").

Released under the MIT License.