Query the construction project database using natural language (Text-to-SQL).
Converts natural language into SQL to retrieve captures, annotations, progress metrics,
schedules, and other project records.
Pass the user's question as-is without modification.
For trade visibility, use `analyze-progress-and-forecasts` instead.
**WORKFLOW:**
- **Default**: call this tool with only `query`. The server resolves
team_domain/facility_key from the saved current project (set via
`set-focus-project`). Do NOT call `list-my-projects`
again just to obtain these values.
- Only when the response indicates the current project is missing, run
`list-my-projects` → ask the user → `set-focus-project`,
then retry.
- Pass explicit team_domain/facility_key **only** when the user
clearly wants to query a different project than the saved one.
**Available tables:**
- progresses: SI progress metrics (level, category, phase, workarea, cost, dates)
- captures: Camera captures metadata (level, camera_model, capture_state, user_email)
- records: Capture events with timestamps (captured_at, state, id)
- photo_notes: Photonotes (description, state, user_email, created_at)
- voice_notes: Voicenotes (level, description, state, user_email, created_at)
- facilities: Site info (name, address, size, location, bim_count, created_at)
- users: User profiles (name, email)
- workareas: Spatial zones (level, name, user_name)
Args:
query: Natural language question (pass as-is, no SQL syntax)
team_domain: Omit by default. Pass only to override the current project.
facility_key: Omit by default. Pass only to override the current project.
Returns:
Query results as tab-separated text
Connector