tool-called 367 B

12345678910111213141516
  1. #!/usr/bin/env bash
  2. set -euo pipefail
  3. command -v jq >/dev/null || { echo "jq required"; exit 127; }
  4. TOOL="$1"
  5. FILE="tool_calls.jsonl"
  6. COUNT=$(jq -s "[.[] | select(.tool == \"$TOOL\")] | length" "$FILE" 2>/dev/null || echo 0)
  7. if [ "$COUNT" -gt 0 ]; then
  8. echo "PASS: $TOOL called $COUNT time(s)"
  9. exit 0
  10. else
  11. echo "FAIL: $TOOL never called"
  12. exit 1
  13. fi