You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Previously, the `data` field description was just "Array of query data
objects" with no guidance on the required structure. Since
`models.AlertQuery.Model` is `interface{}`, the jsonschema reflector
emits bare `true` for it, giving LLMs no type information about the
model field.
Add a concrete example showing the expected AlertQuery structure
(refId, datasourceUid, relativeTimeRange, model with expr) to all three
Data field descriptions. This helps LLMs construct valid create/update
payloads without needing to guess the nested object structure.
Data []*models.AlertQuery`json:"data" jsonschema:"required,description=Array of query data objects"`
114
+
Data []*models.AlertQuery`json:"data" jsonschema:"required,description=Array of alert query objects. Example: [{refId: 'A'\\, datasourceUid: 'prometheus'\\, relativeTimeRange: {from: 600\\, to: 0}\\, model: {expr: 'vector(1)'\\, refId: 'A'}}]. Use datasourceUid '__expr__' for server-side expressions."`
115
115
NoDataStatestring`json:"noDataState" jsonschema:"required,description=State when no data (NoData\\, Alerting\\, OK)"`
116
116
ExecErrStatestring`json:"execErrState" jsonschema:"required,description=State on execution error (NoData\\, Alerting\\, OK)"`
117
117
Forstring`json:"for" jsonschema:"required,description=Duration before alert fires (e.g. '5m')"`
@@ -216,7 +216,7 @@ type ManageRulesReadWriteParams struct {
216
216
RuleGroupstring`json:"rule_group,omitempty" jsonschema:"description=The rule group name (required for 'create'\\, 'update')"`
217
217
FolderUIDstring`json:"folder_uid,omitempty" jsonschema:"description=The folder UID. For 'list': filter by exact folder UID (mutually exclusive with search_folder). For 'create'/'update': the folder to store the rule in (required)."`
218
218
Conditionstring`json:"condition,omitempty" jsonschema:"description=The query condition identifier\\, e.g. 'A'\\, 'B' (required for 'create'\\, 'update')"`
219
-
Data []*models.AlertQuery`json:"data,omitempty" jsonschema:"description=Array of query data objects (required for 'create'\\, 'update')"`
219
+
Data []*models.AlertQuery`json:"data,omitempty" jsonschema:"description=Array of alert query objects (required for 'create' and 'update'). Example: [{refId: 'A'\\, datasourceUid: 'prometheus'\\, relativeTimeRange: {from: 600\\, to: 0}\\, model: {expr: 'vector(1)'\\, refId: 'A'}}]. Use datasourceUid '__expr__' for server-side expressions. The 'condition' field must reference one of the refIds."`
220
220
NoDataStatestring`json:"no_data_state,omitempty" jsonschema:"description=State when no data: NoData\\, Alerting\\, OK (required for 'create'\\, 'update')"`
221
221
ExecErrStatestring`json:"exec_err_state,omitempty" jsonschema:"description=State on execution error: NoData\\, Alerting\\, OK (required for 'create'\\, 'update')"`
222
222
Forstring`json:"for,omitempty" jsonschema:"description=Duration before alert fires\\, e.g. '5m' (required for 'create'\\, 'update')"`
0 commit comments