#!/usr/bin/env sh
set -eu

GOAL="${*:-recover from failed tool call and preserve continuity}"

curl -s https://api.delx.ai/v1/mcp \
  -H 'content-type: application/json' \
  -d "$(printf '%s' "$GOAL" | python3 -c 'import json,sys; goal=sys.stdin.read(); print(json.dumps({"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"get_ontology_next_action","arguments":{"current_goal":goal,"response_mode":"model_safe","response_profile":"machine"}}}))')"
