Related queries and mutations in Monitors. Each has its own section.
Queries
evaluateDataSource (query)
evaluateDataSource is a query in the Monte Carlo GraphQL API, in Monitors. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.
Evaluates a data source
Arguments
| Argument | Type | Description |
|---|---|---|
dataSourceType | DataSourceType! | Data source type |
connectionId | UUID | Connection UUID |
dwId | UUID | Warehouse UUID |
mcon | String | MCON to evaluate |
sql | String | SQL to evaluate |
transforms | [TransformInput!] | Transforms to apply to the data source |
Returns
Example
query EvaluateDataSource($dataSourceType: DataSourceType!) {
evaluateDataSource(dataSourceType: $dataSourceType) {
connectionUuid
warehouseUuid
mcons
rowCount
unresolvedMcons
whereCondition
}
}Related types
DataSourceEvaluationResult, DataSourceType, TransformInput, UUID
evaluateSqlBlocks (query)
evaluateSqlBlocks is a query in the Monte Carlo GraphQL API, in Monitors. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.
Status: Experimental
Evaluates the provided SQL blocks
Arguments
| Argument | Type | Description |
|---|---|---|
connectionId | UUID | Connection UUID |
dwId | UUID | Warehouse UUID |
dataSource | DataSourceUnionInput! | The data source |
sqlBlocks | CustomRuleSqlBlocksInput! | The SQL blocks |
countRows | Boolean | Whether to count the number of rows returned by the SQL blocks Default: false. |
validateCustomSql | Boolean | Whether to validate the custom and generated SQL by running it against the data warehouse Default: true. |
resolveTransformQueries | Boolean | return a query for each transform in the data source. Default: false. |
Returns
SqlBlockEvaluationResult
Example
query EvaluateSqlBlocks($dataSource: DataSourceUnionInput!, $sqlBlocks: CustomRuleSqlBlocksInput!) {
evaluateSqlBlocks(dataSource: $dataSource, sqlBlocks: $sqlBlocks) {
sql
rowCount
dataSourceSql
fragments
transformQueries
}
}Types used only by evaluateSqlBlocks
evaluateSqlBlocksSqlBlockEvaluationResult
SqlBlockEvaluationResultObject type.
| Field | Type | Description |
|---|---|---|
errors | [Error!]! | |
sql | String | |
rowCount | Int | |
dataSourceSql | String | |
fragments | GenericScalar | |
transformQueries | [String!] |
Related types
CustomRuleSqlBlocksInput, DataSourceUnionInput, Error, GenericScalar, UUID
generateMcSql (query)
generateMcSql is a query in the Monte Carlo GraphQL API, in Monitors. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.
Returns a presentable format of alert conditions
Arguments
| Argument | Type | Description |
|---|---|---|
connectionId | UUID | Connection UUID |
dwId | UUID | Warehouse UUID |
dataSource | DataSourceUnionInput! | The data source |
sqlBlocks | CustomRuleSqlBlocksInput! | The SQL blocks |
Returns
McSqlResult
Example
query GenerateMcSql($dataSource: DataSourceUnionInput!, $sqlBlocks: CustomRuleSqlBlocksInput!) {
generateMcSql(dataSource: $dataSource, sqlBlocks: $sqlBlocks) {
sql
fragments
}
}Types used only by generateMcSql
generateMcSqlMcSqlResult
McSqlResultObject type.
| Field | Type | Description |
|---|---|---|
errors | [Error!]! | |
sql | String | |
fragments | GenericScalar |
Related types
CustomRuleSqlBlocksInput, DataSourceUnionInput, Error, GenericScalar, UUID
getSpanPredicates (query)
getSpanPredicates is a query in the Monte Carlo GraphQL API, in Monitors. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.
Status: Experimental
Gets all available span predicates for agent trajectory monitors
Returns
[SpanPredicate!]
Example
query GetSpanPredicates {
getSpanPredicates {
name
description
arity
allowManyRight
allowNegation
negatedDescription
category
hint
allowedComparisonOperators
supportedConnections
}
}Types used only by getSpanPredicates
getSpanPredicatesSpanPredicate
SpanPredicateObject type.
| Field | Type | Description |
|---|---|---|
name | String! | |
description | String! | |
arity | SpanPredicateArity! | |
allowManyRight | Boolean! | |
allowNegation | Boolean! | |
negatedDescription | String | |
category | String | |
hint | String | |
allowedComparisonOperators | [FilterSpanComparisonOperator!] | |
minimumCounts | [SpanPredicateMinimumCount!] | |
supportedConnections | [String!]! |
SpanPredicateArity
SpanPredicateArityEnum type. Arity types for span predicates.
| Value | Description |
|---|---|
SPAN_OCCURRENCE | |
SPAN_RELATION |
SpanPredicateMinimumCount
SpanPredicateMinimumCountObject type.
| Field | Type | Description |
|---|---|---|
operator | FilterSpanComparisonOperator! | |
count | Int! |
Related types
getSqlPredicates (query)
getSqlPredicates is a query in the Monte Carlo GraphQL API, in Monitors. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.
Returns
[Predicate]
Example
query GetSqlPredicates {
getSqlPredicates {
name
description
sql
arity
supportedTypes
requiredType
allowManyLeft
allowManyRight
usedInLiteralRight
usedInLiteralLeft
allowNegation
negatedDescription
negatedSql
category
supportedConnections
mcSqlSupported
pythonEval
rightRequiredType
}
}Types used only by getSqlPredicates
getSqlPredicatesOverride
OverrideObject type.
| Field | Type | Description |
|---|---|---|
dialect | SqlDialect! | |
sql | String! | |
negatedSql | String |
Predicate
PredicateObject type.
| Field | Type | Description |
|---|---|---|
name | String! | |
description | String! | |
sql | String! | |
arity | PredicateArity! | |
overrides | [Override!]! | |
supportedTypes | [FieldType!]! | |
requiredType | PredicateRequiredType! | |
allowManyLeft | Boolean! | |
allowManyRight | Boolean! | |
usedInLiteralRight | Boolean! | |
usedInLiteralLeft | Boolean! | |
allowNegation | Boolean! | |
negatedDescription | String | |
negatedSql | String | |
category | String | |
supportedConnections | [String!]! | |
mcSqlSupported | Boolean! | |
pythonEval | String | |
rightRequiredType | PredicateRequiredType |
PredicateArity
PredicateArityEnum type.
| Value | Description |
|---|---|
BINARY | |
UNARY |
SqlDialect
SqlDialectEnum type.
| Value | Description |
|---|---|
BIGQUERY | |
REDSHIFT | |
SNOWFLAKE | |
HIVE | |
PRESTO | |
SPARK | |
ATHENA | |
DATABRICKS | |
POSTGRES | |
SQL_SERVER | |
TSQL | |
TERADATA | |
ORACLE | |
MYSQL | |
MARIADB | |
SAPHANA | |
MOTHERDUCK | |
DB2 | |
DREMIO | |
SALESFORCE_CRM | |
SALESFORCE_DATA_CLOUD | |
CLICKHOUSE | |
STARBURST_GALAXY | |
STARBURST_ENTERPRISE | |
CUSTOM_CONNECTOR | |
UNKNOWN |
Related types
FieldType, PredicateRequiredType
getTransformFunctions (query)
getTransformFunctions is a query in the Monte Carlo GraphQL API, in Monitors. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.
Status: Experimental
Gets all available transform functions
Arguments
| Argument | Type | Description |
|---|---|---|
includeConversationFunctions | Boolean | When true, returns conversation-level LLM-as-judge templates (conversation: true) in addition to single-turn warehouse-executable transforms. Default returns only single-turn transforms so warehouse-facing callers are unaffected. Default: false. |
Returns
[TransformFunction!]
Example
query GetTransformFunctions {
getTransformFunctions {
name
title
description
sql
supportedTypes
requiredType
supportedConnections
category
prompt
scoreField
outputType
outputDescription
supportsFieldRange
usesResponseFormat
supportedOutputTypes
icon
sqlExpressionMap
rubric
biasGuardrail
returns
}
}Types used only by getTransformFunctions
getTransformFunctionsTransformFunction
TransformFunctionObject type.
| Field | Type | Description |
|---|---|---|
name | String! | |
title | String! | |
description | String! | |
sql | String! | |
supportedTypes | [FieldType!]! | |
requiredType | PredicateRequiredType! | |
supportedConnections | [String!]! | |
category | String | |
prompt | String | |
scoreField | String | |
outputType | String | |
outputDescription | String | |
supportsFieldRange | Boolean! | |
usesResponseFormat | Boolean! | |
supportedOutputTypes | [String!]! | |
icon | String | |
sqlExpressionMap | GenericScalar | |
rubric | [String!] | |
scoringAnchors | [TransformScoringAnchor!] | |
biasGuardrail | String | |
returns | String | |
customize | String | |
conversation | Boolean! | |
includeToolCallsDefault | Boolean! |
TransformScoringAnchor
TransformScoringAnchorObject type.
| Field | Type | Description |
|---|---|---|
score | String! | |
description | String! |
Related types
FieldType, GenericScalar, PredicateRequiredType
getWarehouseSupportedLlmModels (query)
getWarehouseSupportedLlmModels is a query in the Monte Carlo GraphQL API, in Monitors. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.
Status: Experimental
Gets all available LLM models across warehouse types
Arguments
| Argument | Type | Description |
|---|---|---|
warehouseUuid | UUID | Warehouse UUID. If provided, the connection type will be ignored. |
connectionType | String | connection type, for example "snowflake", "bigquery", etc. |
Returns
[LLMModel!]
Example
query GetWarehouseSupportedLlmModels {
getWarehouseSupportedLlmModels {
name
description
warehouseType
category
contextWindow
regions
default
requiresCrossRegionInference
}
}Types used only by getWarehouseSupportedLlmModels
getWarehouseSupportedLlmModelsLLMModel
LLMModelObject type.
| Field | Type | Description |
|---|---|---|
name | String! | |
description | String! | |
warehouseType | String! | |
category | String! | |
contextWindow | Int! | |
regions | GenericScalar | |
default | Boolean! | |
requiresCrossRegionInference | Boolean! |
Related types
Mutations
createOrUpdateValidation (mutation)
createOrUpdateValidation is a mutation in the Monte Carlo GraphQL API, in Monitors. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.
Create or update a validation
Arguments
| Argument | Type | Description |
|---|---|---|
alertCondition | FilterGroupInput! | |
alertGrouping | AlertGroupingInput | Per-monitor alert grouping configuration. Omit or pass null for legacy per-type grouping; a non-null value enables monitor-based alert grouping. The createOrUpdate* mutations are full-state: omitting this field on an update clears any existing configuration (same as samplingConfig). |
audienceConditions | [AudienceConditionInput!] | Narrows individual audiences to the triage priorities that reach them. Always a full replace: omitting the argument (or passing null) makes every audience unconditional, the same as passing an empty list; a non-empty list replaces the conditions wholesale. Every audience named here must also appear in this mutation's audience list (audiences, or labels on the mutations that spell it that way), which stays the monitor's full audience set — a condition narrows when one of them is notified, it does not add one. |
autoTriage | Boolean | Per-monitor automated-triage override. true forces triage on for this monitor, false forces it off, and null (or omitting the argument) clears the override so the monitor inherits the domain/account setting. Because omitting the argument clears the override, an update call that does not send this field will reset any previously set override, including a deliberate false, back to inherit. |
autoTuning | Boolean | Per-monitor auto-apply-tuning override. true forces auto-apply tuning on for this monitor, false forces it off, and null (or omitting the argument) clears the override so the monitor inherits the domain/account setting. Because omitting the argument clears the override, an update call that does not send this field will reset any previously set override, including a deliberate false, back to inherit. |
connectionId | UUID | Specify a connection (e.g. query-engine) to use |
customRuleUuid | UUID | UUID of custom rule, to update existing rule |
dataQualityDimension | String | Data quality dimension on the custom rule. |
dataSource | DataSourceUnionInput! | |
description | String! | Description of rule |
domainUuids | [UUID!] | Please provide one and only one valid domain uuid. |
dryRun | Boolean | Dry run the monitor creation or update and return the MaC YAML and queries. Default: false. |
dwId | UUID! | Warehouse UUID |
eventRollupCount | Int | The number of events to roll up into a single incident |
eventRollupUntilChanged | Boolean | If true, roll up events until the value changes |
exceptionPrimaryKeyColumn | String | Specifies the column which contains the primary key for sampled data used in exception management. |
failOnReset | Boolean | Return an error if the update is a significant change that would reset the monitor (e.g. switching threshold type). Lets the UI warn before resetting. Default: false. |
failureAudiences | [String!] | The audiences to notify on failure |
intervalMinutes | Int | How often to run scheduled custom rule check (DEPRECATED, use schedule instead) |
isDraft | Boolean | Make target a draft monitor. Default: false. |
labels | [String] | The monitor labels |
notes | String | Additional context for the monitor Default: "". |
notifyRuleRunFailure | Boolean | DEPRECATED: Completely ignored. This field has no effect on anything. Use failure_audiences to determine who is notified when run failures occur. |
percentageOperator | ValidationPercentageThresholdOperator | Comparison operator for validation percentage thresholds. Defaults to GT when percentage_threshold is set without an operator. |
percentageThreshold | Float | Percentage threshold to alert on as a percentage of total rows. |
priority | String | The default priority for alerts involving this monitor |
scheduleConfig | ScheduleConfigInput! | Schedule of the validation |
severity | String | DEPRECATED. Use priority instead. The default severity for incidents involving this monitor Default: "". |
startTime | DateTime | Start time of schedule (DEPRECATED, use schedule instead) |
tags | [TagKeyValuePairInput] | The monitor tags. |
timeFilter | ValidationTimeFilterInput | Optional rolling time-window filter scoping the validation query at every run. Omitted on update clears any previously saved filter. |
timeout | Int | Timeout for the SQL query |
timezone | String | Timezone (DEPRECATED, use timezone in scheduleConfig instead |
Returns
CreateOrUpdateValidation
Example
mutation CreateOrUpdateValidation($alertCondition: FilterGroupInput!, $dataSource: DataSourceUnionInput!, $description: String!, $dwId: UUID!, $scheduleConfig: ScheduleConfigInput!) {
createOrUpdateValidation(alertCondition: $alertCondition, dataSource: $dataSource, description: $description, dwId: $dwId, scheduleConfig: $scheduleConfig) {
yaml
queries
persistBlockedBy
spendGuardrailMessage
}
}Types used only by createOrUpdateValidation
createOrUpdateValidationCreateOrUpdateValidation
CreateOrUpdateValidationObject type. Create or update a validation
| Field | Type | Description |
|---|---|---|
validation | CustomRule | |
yaml | String | |
queries | [String!] | SQL queries that will be run by the monitor on each execution. |
estimatedCredits | EstimatedCredits | Spec-derived daily credit estimate. Computed from the provided input config, not from persisted DB state — so dry-run, draft, and full create/update all return a consistent preview. Only populated for accounts on the per-monitor credit consumption pricing model; null otherwise. |
persistBlockedBy | String | Set on dry runs only. Says why saving this monitor would not give the result the preview shows. A permission path, such as monitors/management/metric/edit, means the caller lacks it and the save would be refused. The caller can still save the monitor as a draft if it has the monitor type's draft permission. SPEND_GUARDRAIL means a spend guardrail is reached, so the save would create this new monitor as a draft instead of live. spendGuardrailMessage names the guardrail. When both apply, the permission path is returned. Null when the save would go through as previewed, and on requests that are not dry runs. |
spendGuardrailMessage | String | Set when a reached spend guardrail makes the save create this new monitor as a draft instead of live: on a dry run, when the save would do so, and on the save itself, when it did. A sentence for the user that names the guardrail (the account's or a domain's), its amount and when it resets, and says that an Account Owner can raise it. On a dry run whose persistBlockedBy is a permission path, the save is refused instead, so read that first. Null otherwise, including for a monitor saved as a draft on request, and for updates to an existing monitor. |
ValidationPercentageThresholdOperator
ValidationPercentageThresholdOperatorEnum type.
| Value | Description |
|---|---|
GT | |
GTE | |
EQ | |
LT | |
LTE |
ValidationRollingWindowHoursInput
ValidationRollingWindowHoursInputInput object type. Rolling-window time filter for validation monitors with a custom length. Combines a date/timestamp column with a number of hours evaluated relative to the run time.
| Field | Type | Description |
|---|---|---|
timeField | FilterValueFieldInput! | The date/timestamp column the rolling window filters on. |
lookbackInHrs | Int! | Rolling-window length in hours, evaluated relative to each run's start time. Must be at least 1. |
ValidationRollingWindowInput
ValidationRollingWindowInputInput object type. Structured rolling-window time filter for validation monitors. Combines a date/timestamp column with one of a fixed set of rolling periods evaluated relative to the run time.
| Field | Type | Description |
|---|---|---|
timeField | FilterValueFieldInput! | The date/timestamp column the rolling window filters on. |
period | ValidationTimeWindowPeriod! | Rolling-window length, evaluated relative to each run's start time. |
ValidationTimeFilterInput
ValidationTimeFilterInputInput object type. Optional time-window filter applied to a form-mode validation monitor. Exactly one of rollingWindow (column + period), rollingWindowHours (column + number of hours) or sqlExpression (free-form SQL fragment) must be set. Omit the argument entirely to clear any previously-saved filter.
| Field | Type | Description |
|---|---|---|
rollingWindow | ValidationRollingWindowInput | Structured filter: a date/timestamp column plus a rolling window. Mutually exclusive with rollingWindowHours and sqlExpression. |
rollingWindowHours | ValidationRollingWindowHoursInput | Structured filter: a date/timestamp column plus a rolling window of any number of hours. Mutually exclusive with rollingWindow and sqlExpression. |
sqlExpression | String | Free-form SQL fragment used as the WHERE clause for the time filter. The fragment is rendered verbatim into the executed query. Mutually exclusive with rollingWindow and rollingWindowHours. Must be a boolean WHERE-clause expression — expressions beginning with SELECT (case-insensitive, ignoring leading whitespace and zero-width characters) are rejected. |
ValidationTimeWindowPeriod
ValidationTimeWindowPeriodEnum type. Rolling-window period for a validation monitor's time filter. Each value maps to a fixed number of hours evaluated relative to run start time:
PAST_HOUR= 1 hourPAST_1_DAY= 24 hoursPAST_2_DAYS= 48 hoursPAST_3_DAYS= 72 hoursPAST_5_DAYS= 120 hoursPAST_1_WEEK= 168 hoursPAST_2_WEEKS= 336 hoursPAST_3_WEEKS= 504 hoursPAST_4_WEEKS= 672 hours
| Value | Description |
|---|---|
PAST_HOUR | |
PAST_1_DAY | |
PAST_2_DAYS | |
PAST_3_DAYS | |
PAST_5_DAYS | |
PAST_1_WEEK | |
PAST_2_WEEKS | |
PAST_3_WEEKS | |
PAST_4_WEEKS |
Related types
AlertGroupingInput, AudienceConditionInput, CustomRule, DataSourceUnionInput, DateTime, EstimatedCredits, FilterGroupInput, FilterValueFieldInput, ScheduleConfigInput, TagKeyValuePairInput, UUID
Source: The GraphQL API reference
This page is generated from the GraphQL schema on each release. Changes made in ReadMe are overwritten.
