This repository has been archived on 2026-06-13. You can view files and clone it, but cannot push or open issues or pull requests.
anvillm/mcptools/set_state.sh

19 lines
517 B
Bash
Executable File

#!/bin/bash
# capabilities: agents
# description: Set agent state: AGENT_ID STATE (idle|running|stopped|starting|error|exited)
set -euo pipefail
agent_id="${1:?Usage: set_state <agent_id> <state>}"
state="${2:?Usage: set_state <agent_id> <state>}"
case "$state" in
idle|running|stopped|starting|error|exited)
echo "$state" | 9p write "agent/${agent_id}/state"
;;
*)
echo "Invalid state: $state" >&2
echo "Valid states: idle, running, stopped, starting, error, exited" >&2
exit 1
;;
esac