#!/usr/bin/env bash
set -euo pipefail

QUERY="$*"
if [ -z "$QUERY" ]; then
  echo "Usage: $0 <query>"
  exit 1
fi

# Use claude -p (print/subprocess mode) with allowedTools to enable web search
# The tools list includes web_search (standard), WebSearch (alternative), and mcp__* (all MCP tools)
claude -p "Search the web for '$QUERY'. Provide a summary of findings." \
  --allowedTools "web_search,WebSearch,mcp__*"
