42UVPZU3N47BJIV5KBUN4KDB2JKP5QCGMNEOTZTLWP2XNUCNOARAC W4KEYSU7BH2BURGWJC4SQ7IE6JCKRFXNKU54E5SXMB3SCICZXDWAC L4STQEXDGCPZXDHTEUBCOQKBMTFDRVXRLNFQHPDHOVXDCJO33LQQC 7NS27QXZMVTZBK4VPMYL5IKGSTTAWR6NDG5SOVITNX44VNIRZPMAC NAZQZRYQTXWVE2VFY65ONSD6O3EUMNRHARCDVH2D2HKM3YH4RGUAC 2Y2ZW565SRONQ2UXPLX5SRP2HDFWMRF5KDXKSKVRCHBBGEGMTVIQC HCOPW5FXSTZYJNQNXT3H7SVD34DMPYHRFGL5UFGNR5JYNDXVK7LQC OKSUMZ3O5L5WJU563XBC5VYLJOZXI7QXNN5BTR4DUMYFP6IRZZLAC DORZF5HSV672ZP5HUDYB3J6TBH5O2LMXJE4HPSE7H5SOGZQBDCXQC 65G4H2V6262GLHTPQQ5H4NIPDJB7HRPBRVNAD2EL26N75YUM5PWQC ZVYOPUNH7UJL3YALGNNXQW2B4H4ONI5Z6XWAUZUONFG7LR55W4SQC 5LMYPB2QHNVDLYCRWLOMCPY35ZKHHPYVW5XHASE66L6PJZSOCXYQC IFVRAERTCCDICNTYTG3TX2WASB6RXQQEJWWXQMQZJSQDQ3HLE5OQC 4AFSDSVWQCDWDJEH3DD2S7UUB2LHLQOZLH5SZ6LS4LCSBG4EORXAC QQOATNCITSSIPKVUFNZEPN73TGU244GIAW6K37SILAGQWVQ4TCQQC JCXEAHITH33V2SFDZX6JNPNFHSZPVSVLF556TMXDVJPDWS2TBINAC W3A2EECCD23SVHJZN6MXPH2PAVFHH5CNFD2XHPQRRW6M4GUTG3FAC echo ""# === IMPORT_FILE TOOL ===echo "=== import_audio_file Tool ==="echo ""# Test 1: Non-existent fileecho "Test 1: Non-existent file (should fail)"result=$(send_request "tools/call" '{"name":"import_audio_file","arguments":{"file_path":"/nonexistent/path/to/file.wav","dataset_id":"'"$DATASET_ID"'","location_id":"'"$LOCATION_ID"'","cluster_id":"'"$CLUSTER_ID"'"}}' "$DB_PATH")run_test "Reject non-existent file" "false" "$result"# Test 2: Non-WAV fileecho ""echo "Test 2: Non-WAV file (should fail)"result=$(send_request "tools/call" '{"name":"import_audio_file","arguments":{"file_path":"/etc/passwd","dataset_id":"'"$DATASET_ID"'","location_id":"'"$LOCATION_ID"'","cluster_id":"'"$CLUSTER_ID"'"}}' "$DB_PATH")run_test "Reject non-WAV file" "false" "$result"# Test 3: Invalid dataset ID
echo "Test 3: Invalid dataset_id (should fail)"result=$(send_request "tools/call" '{"name":"import_audio_file","arguments":{"file_path":"/tmp/test.wav","dataset_id":"INVALID123456","location_id":"'"$LOCATION_ID"'","cluster_id":"'"$CLUSTER_ID"'"}}' "$DB_PATH")run_test "Reject invalid dataset_id" "false" "$result"# Test 4: Invalid cluster IDecho ""echo "Test 4: Invalid cluster_id (should fail)"result=$(send_request "tools/call" '{"name":"import_audio_file","arguments":{"file_path":"/tmp/test.wav","dataset_id":"'"$DATASET_ID"'","location_id":"'"$LOCATION_ID"'","cluster_id":"INVALID123456"}}' "$DB_PATH")run_test "Reject invalid cluster_id" "false" "$result"
mcp.AddTool(server, &mcp.Tool{Name: "import_audio_file",Description: "Import a single WAV file into the database. Automatically parses AudioMoth and filename timestamps, calculates hash, extracts metadata, and computes astronomical data. Skips if duplicate (by hash).",}, mcpImportAudioFile)
func mcpImportAudioFile(ctx context.Context, req *mcp.CallToolRequest, input tools.ImportFileInput) (*mcp.CallToolResult, tools.ImportFileOutput, error) {output, err := tools.ImportFile(ctx, input)return &mcp.CallToolResult{}, output, err}
- Structured imports: `import_audio_files`, `import_file`, `bulk_file_import`, `import_ml_selections`
- Structured imports: `import_audio_files`, `bulk_file_import`, `import_ml_selections`
- `import_unstructured` - CLI-only, no location/cluster hierarchy
**CLI-only:**- `import file` - Single file import (use `skraak import file --db ... --path /path/to/file.wav`)- `import_unstructured` - No location/cluster hierarchy
**Rationale:** The MCP tool was redundant since:1. Single file imports are better suited for CLI use (requires file path on local machine)2. `import_audio_files` handles batch imports efficiently via MCP3. Reduces MCP tool count from 11 to 10**Changes:**- **`cmd/mcp.go`** — Removed `import_audio_file` tool registration and adapter- **`tools/import_file.go`** — Kept for CLI use only- **`cmd/import.go`** — CLI command `skraak import file` unchanged**Migration:** Use CLI command instead:```bash./skraak import file --db ./db/skraak.duckdb --dataset abc123 --location loc456 --cluster clust789 --path /path/to/file.wav```---