Related queries and mutations in AI features. Each has its own section.
Queries
createSqlQuery (query)
createSqlQuery is a query in the Monte Carlo GraphQL API, in AI features. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.
Convert natural language into a SQL query
Arguments
| Argument | Type | Description |
|---|---|---|
messages | [AIMessageInput]! | Messages between the user and the AI |
warehouseUuid | UUID! | The identifier of the data warehouse that is being queried |
requestUuid | UUID | The identifier of the request if we want to stream the results |
existingSql | String | SQL in the user's editor when the conversation started. When provided, the generated query edits or extends it instead of starting from scratch |
Returns
Example
query CreateSqlQuery($messages: [AIMessageInput]!, $warehouseUuid: UUID!) {
createSqlQuery(messages: $messages, warehouseUuid: $warehouseUuid) {
message
actor
status
}
}Types used only by createSqlQuery
createSqlQueryAIMessageInput
AIMessageInputInput object type.
| Field | Type | Description |
|---|---|---|
message | String! | Message from the specified actor |
actor | ActorType! | The actor that sends the message |
mcons | [String] | The mcons for the tables added in this message |
Related types
AIMessageOutput, ActorType, UUID
fixSqlQuery (query)
fixSqlQuery is a query in the Monte Carlo GraphQL API, in AI features. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.
Given a SQL query it uses AI to fix it
Arguments
Returns
Example
query FixSqlQuery($sqlQuery: String!, $errorMessage: String!, $warehouseUuid: UUID!) {
fixSqlQuery(sqlQuery: $sqlQuery, errorMessage: $errorMessage, warehouseUuid: $warehouseUuid) {
message
actor
status
}
}Related types
generateEvalPrompt (query)
generateEvalPrompt is a query in the Monte Carlo GraphQL API, in AI features. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.
Status: Experimental
Generate an LLM-as-a-judge evaluation prompt from a description
Arguments
| Argument | Type | Description |
|---|---|---|
descriptionText | String! | Natural language description of what to evaluate |
scale | Scale! | Scoring scale |
contextUsage | ContextUsage! | Which template variables to include in the prompt |
strictness | Strictness! | Strictness tone for evaluation |
mcon | String | MCON of the data source table (required for CUSTOM_FIELDS when schemaFields is not provided) |
connectionUuid | UUID | Connection UUID for schema lookup (used with CUSTOM_FIELDS) |
schemaFields | [EvalSchemaFieldInput!] | Schema fields to use for CUSTOM_FIELDS context usage. When provided, skips internal schema resolution from mcon/connection_uuid. |
Returns
GenerateEvalPromptOutput
Example
query GenerateEvalPrompt($descriptionText: String!, $scale: Scale!, $contextUsage: ContextUsage!, $strictness: Strictness!) {
generateEvalPrompt(descriptionText: $descriptionText, scale: $scale, contextUsage: $contextUsage, strictness: $strictness) {
prompt
alias
outputType
rubric
biasGuardrail
}
}Types used only by generateEvalPrompt
generateEvalPromptContextUsage
ContextUsageEnum type.
| Value | Description |
|---|---|
PROMPT_AND_RESPONSE | |
RESPONSE_ONLY | |
PROMPT_ONLY | |
CUSTOM_FIELDS |
EvalSchemaFieldInput
EvalSchemaFieldInputInput object type.
| Field | Type | Description |
|---|---|---|
name | String! | Field name |
type | String! | Field type (e.g. STRING, NUMBER, BOOLEAN) |
GenerateEvalPromptOutput
GenerateEvalPromptOutputObject type.
| Field | Type | Description |
|---|---|---|
prompt | String! | The generated evaluation prompt template |
alias | String! | Score field name for the transform |
outputType | String! | Output type: 'number' or 'boolean' |
rubric | [String!]! | Evaluation criteria bullets |
scoringAnchors | [ScoringAnchorOutput!]! | Score level descriptions |
biasGuardrail | String! | Bias avoidance guidance |
Scale
ScaleEnum type.
| Value | Description |
|---|---|
SCALE_1_5 | |
SCALE_1_10 | |
SCALE_PASS_FAIL |
ScoringAnchorOutput
ScoringAnchorOutputObject type.
| Field | Type | Description |
|---|---|---|
score | String! | The score value |
description | String! | What this score level means |
Strictness
StrictnessEnum type.
| Value | Description |
|---|---|
LENIENT | |
BALANCED | |
STRICT |
Related types
generateSqlEval (query)
generateSqlEval is a query in the Monte Carlo GraphQL API, in AI features. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.
Status: Experimental
Generate a SQL evaluation expression from a description
Arguments
| Argument | Type | Description |
|---|---|---|
descriptionText | String! | Natural language description of what to evaluate |
outputType | String! | Expected output type: string, number, or boolean |
mcon | String! | MCON of the agent data source |
connectionUuid | UUID | Connection UUID for schema and warehouse type lookup |
Returns
GenerateSqlEvalOutput
Example
query GenerateSqlEval($descriptionText: String!, $outputType: String!, $mcon: String!) {
generateSqlEval(descriptionText: $descriptionText, outputType: $outputType, mcon: $mcon) {
sqlExpression
alias
description
returns
customize
}
}Types used only by generateSqlEval
generateSqlEvalGenerateSqlEvalOutput
GenerateSqlEvalOutputObject type.
| Field | Type | Description |
|---|---|---|
sqlExpression | String! | The SQL expression for evaluation |
alias | String! | A short snake_case score field name |
description | String! | What the SQL expression does |
returns | String! | What the expression returns and when |
customize | String! | How to modify the expression for different use cases |
Related types
Source: The GraphQL API reference
This page is generated from the GraphQL schema on each release. Changes made in ReadMe are overwritten.
