#!/bin/bash
# Simple script to get current time from MCP server

DB_PATH="${1:-../db/skraak.duckdb}"

{
  # Initialize
  echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"cli-test","version":"1.0.0"}}}'
  sleep 0.2

  # Call get_current_time
  echo '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"get_current_time","arguments":{}}}'
  sleep 0.2

} | ../skraak_mcp "$DB_PATH" 2>/dev/null | grep '"id":2' | jq '.result.structuredContent'