halopsa_build_query
Construct SQL queries for HaloPSA data with proper syntax. Build SELECT queries with WHERE conditions, ORDER BY, and LIMIT clauses without writing raw SQL code.
Instructions
Build a basic SQL query for HaloPSA with a helper that ensures proper syntax. Useful for constructing simple SELECT queries with WHERE conditions, ORDER BY, and LIMIT clauses without writing raw SQL.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tableName | Yes | Table to query from (e.g., FAULTS, USERS, SITE) | |
| columns | No | Columns to select (optional, defaults to all). Example: ["Faultid", "Symptom", "Status"] | |
| conditions | No | WHERE conditions as key-value pairs. Example: {"Status": 1, "Priority": 3} | |
| orderBy | No | Column to order results by. Example: "datereported DESC" | |
| limit | No | Maximum number of rows to return. Example: 10 |
Input Schema (JSON Schema)
{
"properties": {
"columns": {
"description": "Columns to select (optional, defaults to all). Example: [\"Faultid\", \"Symptom\", \"Status\"]",
"items": {
"type": "string"
},
"type": "array"
},
"conditions": {
"description": "WHERE conditions as key-value pairs. Example: {\"Status\": 1, \"Priority\": 3}",
"type": "object"
},
"limit": {
"description": "Maximum number of rows to return. Example: 10",
"type": "number"
},
"orderBy": {
"description": "Column to order results by. Example: \"datereported DESC\"",
"type": "string"
},
"tableName": {
"description": "Table to query from (e.g., FAULTS, USERS, SITE)",
"type": "string"
}
},
"required": [
"tableName"
],
"type": "object"
}