Related queries and mutations in Agent traces and evaluations. Each has its own section.
Queries
getConversations (query)
getConversations is a query in the Monte Carlo GraphQL API, in Agent traces and evaluations. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.
Status: Experimental
Get conversations grouped by conversation_id. Each conversation aggregates one or more agent traces (turns) that share the same conversation_id.
Arguments
| Argument | Type | Description |
|---|---|---|
input | GetConversationsInput! |
Returns
ConversationsResult
Example
query GetConversations($input: GetConversationsInput!) {
getConversations(input: $input) {
clusterContentWithheldReason
totalCount
}
}Types used only by getConversations
getConversationsClusterAssignmentType
ClusterAssignmentTypeObject type. One of possibly several clusters assigned to a conversation by its most recent classification run, in the current taxonomy.
| Field | Type | Description |
|---|---|---|
clusterKey | String! | Assigned cluster slug; "uncategorized" if gated / no match. |
clusterName | String! | Display name of the assigned cluster. |
confidence | Float! | Classifier self-reported confidence for the assignment. |
Conversation
ConversationObject type. A conversation groups one or more agent traces sharing the same conversation_id.
| Field | Type | Description |
|---|---|---|
conversationId | String! | Conversation identifier |
turns | Int! | Number of traces (runs) in this conversation |
totalTokens | Int | Sum of tokens across all traces in the conversation |
startTime | DateTime! | Earliest trace start time in the conversation |
endTime | DateTime! | Latest trace end time in the conversation |
durationSeconds | Float! | Total conversation duration in seconds (end_time - start_time) |
activeDurationSeconds | Float! | Sum of each trace's duration in seconds across the conversation, excluding idle gaps between traces. May exceed durationSeconds when traces overlap within the same conversation. |
status | ConversationStatus! | ERROR if any trace had a root span error, otherwise OK |
errorsCount | Int! | Number of spans across all traces in this conversation that errored (excluding LangGraph GraphInterrupt sentinels). |
erroredTurns | Int! | Number of turns containing at least one erroring span (excluding LangGraph GraphInterrupt sentinels). A turn can contain errors even when its overall result is OK. |
workflows | [String!]! | Distinct workflow names across all traces in this conversation. Empty when none of the conversation's spans carry a workflow. |
evalScores | [ConversationEvalScore!]! | Latest stored eval score per (monitor, dimension) for this conversation. Empty when the conversation has not been scored by any conversation eval monitor. |
intentCluster | ClusterAssignmentType | Deprecated in favor of clusterAssignments. The conversation's assignment for the requested clustering scope, on a space that carries at most one assignment per conversation (e.g. intent) — the single-assignment convenience for such a space. On a space that can carry several assignments, this field is the highest-confidence one. Null when the conversation is unclassified or no clustering scope was requested. Null when cluster content access is denied. |
clusterAssignments | [ClusterAssignmentType!]! | Every assignment from the conversation's most recent classification run in the requested clustering scope, ordered highest-confidence first. Empty when the conversation is unclassified or no clustering scope was requested. Empty when cluster content access is denied. |
feedback | ConversationFeedbackCounts | End-user feedback counts across the conversation's turns. Null when feedback is unavailable or no turn has feedback. Supported for Snowflake Cortex and Databricks Genie agents on Timescale, and code-based agents on ClickHouse that have sent feedback. |
ConversationEvalScore
ConversationEvalScoreObject type. The latest stored eval score for one (monitor, dimension) on a conversation.
Produced by agent evaluation monitors scoped to conversations; surfaced so the
list/detail can show per-dimension scores. Only the most recent score per
(monitor, dimension) is returned.
| Field | Type | Description |
|---|---|---|
monitorUuid | UUID! | The evaluation monitor that produced this score |
evalType | String! | The scored dimension (e.g. task_completion_score, helpfulness_score) |
score | Float! | Numeric score for the dimension |
reasoning | String | The judge's short explanation for the score |
scoredAt | DateTime! | When this score was produced |
ConversationFeedbackCounts
ConversationFeedbackCountsObject type. Counts of a conversation's turns that have end-user feedback, by their newest feedback.
The rating counts cover only turns with feedback. withComment overlaps them.
| Field | Type | Description |
|---|---|---|
positive | Int! | |
negative | Int! | |
unrated | Int! | Turns whose feedback has no rating |
withComment | Int! | Turns whose newest feedback carries a comment, at any rating |
ConversationFiltersInput
ConversationFiltersInputInput object type. Filters for the getConversations query.
| Field | Type | Description |
|---|---|---|
conversationIdSearch | String | Case-insensitive substring search on conversation_id |
traceId | String | Filter by exact trace ID (hex-encoded) — returns the conversation that contains this trace |
workflows | [String!] | Filter by workflow names (OR logic). Empty or omitted returns all. |
workflowAgent | String | Scope to one workflow agent: keep only the traces whose first non-empty workflow, by span start order within the time range, equals this value, so each conversation counts that workflow agent's turns. Supported on ClickHouse trace tables only, and cannot be combined with workflows. Must not be blank, and at most 256 characters. |
statuses | [ConversationStatus!] | Filter by status (ERROR, OK). Empty or omitted returns all. |
hasErrors | [HasErrorsValue!] | Filter by presence of erroring spans across the conversation's traces (excluding LangGraph GraphInterrupt sentinels). Values: 'OK' or 'HAS_ERRORS' (OR logic). Empty or omitted returns all. Composes with statuses — e.g. statuses=[OK] AND hasErrors=[HAS_ERRORS] surfaces conversations that completed cleanly but had retried/recovered errors along the way. |
minTurns | Int | Minimum number of turns (inclusive) |
maxTurns | Int | Maximum number of turns (inclusive) |
minTotalTokens | Int | Minimum total tokens (inclusive) |
maxTotalTokens | Int | Maximum total tokens (inclusive) |
minCost | Float | Minimum token cost of a conversation, in the agent's costUnit (credits, or the customer's currency when cost rates apply). A conversation with no priceable span has an unknown token cost and matches no bound. One with some priced spans is bounded on those only. Resolved by scanning the agent's Snowflake event table, which only Cortex agents have, so it matches nothing for any other agent. |
maxCost | Float | Maximum token cost of a conversation, in the same costUnit |
minQueryCost | Float | Minimum query cost of a conversation: the warehouse compute cost attributed to its SQL queries, in the same costUnit. Attribution trails execution by about three hours and excludes warehouse idle time, so the figure is a lower bound. Queries not yet attributed read as zero, not as unknown. Matches nothing for any agent without a Snowflake event table, which is every agent except Cortex. |
maxQueryCost | Float | Maximum query cost of a conversation, in the same costUnit |
minTotalCost | Float | Minimum total cost of a conversation: token cost plus query cost, in the same costUnit. Unpriced tokens and queries still awaiting attribution contribute zero, so the total is a lower bound. Matches nothing for any agent without a Snowflake event table, which is every agent except Cortex. |
maxTotalCost | Float | Maximum total cost of a conversation, in the same costUnit |
minDuration | Float | Minimum conversation duration in seconds |
maxDuration | Float | Maximum conversation duration in seconds |
minActiveDuration | Float | Minimum active (processing) duration in seconds — sum of per-turn processing time, excluding idle gaps between turns |
maxActiveDuration | Float | Maximum active (processing) duration in seconds — sum of per-turn processing time, excluding idle gaps between turns |
clusterKeys | [String!] | Filter the list to conversations assigned to these clusters (within the query's clusteringSpaceUuid — intent or issue facet). Empty or omitted applies no cluster filter; requires clusteringSpaceUuid to be set. |
runUuid | UUID | Filter to the conversations evaluated in a monitor run: pass an agent evaluation monitor run's jobExecutionUuid (as surfaced on monitor chart datapoints) to keep only conversations that were scored in that run. Combines (ANDs) with the other filters. Only conversation-aggregation agent evaluation runs carry per-conversation score linkage: span-scored runs return an empty page, and trace-aggregation runs are rejected, as are runs that evaluated more than 500 conversations (rather than returning an incomplete list). startTime/endTime still bound the span scan — pass a window generously covering the run's period so boundary conversations aggregate completely. |
feedbackRatings | [TraceFeedbackRating!] | Filter by end-user feedback (OR logic). A conversation matches a rating when any turn's newest feedback has it. NO_FEEDBACK matches a conversation when no turn has feedback. Supported for Snowflake Cortex and Databricks Genie agents on Timescale, and code-based agents on ClickHouse that have sent feedback. |
hasFeedbackComment | [HasFeedbackCommentValue!] | Filter by whether any turn's newest end-user feedback carries a comment (OR logic). NO_COMMENT matches a conversation when no turn has a comment, including one with no feedback. Supported for Snowflake Cortex and Databricks Genie agents on Timescale, and code-based agents on ClickHouse that have sent feedback. |
ConversationSortField
ConversationSortFieldEnum type. Fields that can be used for sorting conversations.
| Value | Description |
|---|---|
CONVERSATION_ID | |
START_TIME | |
END_TIME | |
DURATION_SECONDS | |
ACTIVE_DURATION_SECONDS | |
TURNS | |
TOTAL_TOKENS | |
STATUS | |
EVAL_SCORE | |
EVAL_SCORES_COUNT | |
NEGATIVE_FEEDBACK_COUNT |
ConversationStatus
ConversationStatusEnum type. Status of a conversation derived from root span errors.
| Value | Description |
|---|---|
OK | |
ERROR |
ConversationsResult
ConversationsResultObject type. Result of the getConversations query.
| Field | Type | Description |
|---|---|---|
clusterContentWithheldReason | RawContentWithheldReason | Why cluster assignments were withheld, or null when they were not. |
conversations | [Conversation!]! | Conversations for the current page |
pageInfo | TracePageInfo! | Pagination metadata |
totalCount | Int | Total number of conversations matching the request's filters (and clusteringSpaceUuid when provided), independent of pagination. Use to display a row count such as 'Viewing X of Y conversations'. Null when the client did not request this field or on cursor pages (page 2+); clients should preserve the first-page value across pages. |
GetConversationsInput
GetConversationsInputInput object type. Input parameters for the getConversations query.
| Field | Type | Description |
|---|---|---|
agentName | String! | Agent name to filter by |
traceTableMcon | String! | MCON of the trace table or platform agent (aiagent object type) to query |
startTime | DateTime! | Start of time range (inclusive) |
endTime | DateTime! | End of time range (inclusive) |
filters | ConversationFiltersInput | Optional filters |
clusteringSpaceUuid | UUID | Clustering scope for this query — a space of either facet. When set, each conversation's cluster assignments are populated from this space's current taxonomy, and any clusterKeys filter resolves against it. Omit to exclude cluster assignments. |
first | Int | Number of conversations to fetch (forward pagination) |
after | String | Cursor for forward pagination |
last | Int | Number of conversations to fetch (backward pagination) |
before | String | Cursor for backward pagination |
sortField | ConversationSortField | Field to sort by (default: start_time). EVAL_SCORE sorts by one (monitor, dimension) column and requires sortEvalType + sortEvalMonitorUuid. EVAL_SCORES_COUNT sorts by how many eval score entries each conversation carries (the length of its evalScores array) — ascending puts conversations with no scores first, descending puts the most-evaluated conversations first; no extra inputs required. NEGATIVE_FEEDBACK_COUNT sorts by how many turns' newest end-user feedback is negative. A conversation with feedback but no negative turns sorts as 0. Conversations with no feedback sort last in both directions. Supported for Snowflake Cortex and Databricks Genie agents on Timescale, and code-based agents on ClickHouse that have sent feedback. Default: "start_time". |
sortDirection | TraceSortDirection | Sort direction (default: DESC) Default: "DESC". |
sortEvalType | String | The eval score dimension to sort by (e.g. task_completion_score). Required together with sortEvalMonitorUuid when sortField is EVAL_SCORE, ignored otherwise. A sortable eval column is one (monitor, dimension) pair, as surfaced by the evalType/monitorUuid on each conversation's evalScores. |
sortEvalMonitorUuid | UUID | The evaluation monitor whose scores order the list when sortField is EVAL_SCORE (required together with sortEvalType, ignored otherwise; must be one of the account's evaluation monitors). Conversations are ordered by this monitor's latest stored score for the sortEvalType dimension; conversations it never scored sort last in both directions. |
HasErrorsValue
HasErrorsValueEnum type. Bucket values for the "Error spans" filter — counts erroring spans
independently of root status (excluding LangGraph control-flow sentinels
like GraphInterrupt).
Orthogonal to TraceRootStatus / ConversationStatus: a trace with
TraceRootStatus.OK can still have HasErrorsValue.HAS_ERRORS — that's the
canonical "root succeeded but a child span errored or was retried" case.
| Value | Description |
|---|---|
OK | |
HAS_ERRORS |
Related types
DateTime, HasFeedbackCommentValue, RawContentWithheldReason, TraceFeedbackRating, TracePageInfo, TraceSortDirection, UUID
getConversationsFilters (query)
getConversationsFilters is a query in the Monte Carlo GraphQL API, in Agent traces and evaluations. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.
Status: Experimental
Get metadata about filters available for the Conversations tab — field name, display name, input parameter, and whether it is a range slider or checkbox filter. Static; no input required.
Returns
[ConversationFilter!]!
Example
query GetConversationsFilters {
getConversationsFilters {
fieldName
displayName
queryParameterName
queryParameterAcceptsMultipleValues
isRangeFilter
facetSearchable
}
}Types used only by getConversationsFilters
getConversationsFiltersConversationFilter
ConversationFilterObject type. Metadata about a single conversation filter.
Mirrors TraceFilter — tells the frontend what filters exist, how to
render them (slider vs checkbox), and which input parameter to use.
| Field | Type | Description |
|---|---|---|
fieldName | ConversationFilterFieldName! | |
displayName | String! | |
queryParameterName | String! | Corresponding parameter name(s) in ConversationFiltersInput |
queryParameterAcceptsMultipleValues | Boolean! | Whether the associated getConversations parameter accepts multiple values as input |
isRangeFilter | Boolean! | True → render as a min/max slider; False → render as checkboxes |
facetSearchable | Boolean! | Whether the filter values can be searched by their display name |
Related types
getConversationsFiltersData (query)
getConversationsFiltersData is a query in the Monte Carlo GraphQL API, in Agent traces and evaluations. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.
Status: Experimental
Get actual filter values for the current time window: min/max bounds for range filters (turns, tokens, duration) and available enum values for checkbox filters (status). Used to configure slider ranges and populate checkboxes with only the options present in the data.
Arguments
| Argument | Type | Description |
|---|---|---|
input | GetConversationsFiltersDataInput! |
Returns
[ConversationFilterData!]!
Example
query GetConversationsFiltersData($input: GetConversationsFiltersDataInput!) {
getConversationsFiltersData(input: $input) {
fieldName
minValue
maxValue
}
}Types used only by getConversationsFiltersData
getConversationsFiltersDataConversationFilterData
ConversationFilterDataObject type. Actual data for a single conversation filter in the current time window.
For range filters (turns, tokens, duration): min_value and max_value are set.
For enum filters (status): values is set with the options present in the data.
| Field | Type | Description |
|---|---|---|
fieldName | ConversationFilterFieldName! | |
minValue | Float | Minimum value (range filters only) |
maxValue | Float | Maximum value (range filters only) |
values | [ConversationFilterValue!] | Available values (enum filters only) |
ConversationFilterValue
ConversationFilterValueObject type. A single value available for an enum conversation filter.
| Field | Type | Description |
|---|---|---|
value | String! | Raw value (e.g. 'OK', 'ERROR') |
displayName | String! | Human-readable label |
count | Int! | Number of conversations with this value |
Related types
ConversationFilterFieldName, GetConversationsFiltersDataInput
getConversationThread (query)
getConversationThread is a query in the Monte Carlo GraphQL API, in Agent traces and evaluations. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.
Status: Experimental
Get LLM spans for a conversation ordered chronologically as a thread. Returns spans with is_tool_call=true, has_prompts=true, or has_completions=true for the given conversation_id, enabling inspection of the full prompt/completion exchange.
Arguments
| Argument | Type | Description |
|---|---|---|
input | GetConversationThreadInput! |
Returns
ConversationThreadResult
Example
query GetConversationThread($input: GetConversationThreadInput!) {
getConversationThread(input: $input) {
warehouseQuery
}
}Types used only by getConversationThread
getConversationThreadConversationSpan
ConversationSpanObject type. A single span in a conversation thread (is_tool_call, has_prompts, or has_completions).
| Field | Type | Description |
|---|---|---|
spanId | String! | Span ID (hex-encoded) |
traceId | String! | Trace ID (hex-encoded) |
name | String! | Span name |
model | String | LLM model used |
startTime | DateTime! | Span start time |
endTime | DateTime! | Span end time |
durationSeconds | Float! | Span duration in seconds |
promptTokens | Int | Number of prompt tokens |
completionTokens | Int | Number of completion tokens |
totalTokens | Int | Total tokens (prompt + completion) |
isToolCall | Boolean | Whether span represents a tool call |
status | Int | OTel status code (0=unset, 1=ok, 2=error); null when the span carries no status |
prompts | GenericScalar | Raw prompt messages JSON string fetched from the warehouse |
completions | GenericScalar | Raw completion messages JSON string fetched from the warehouse |
ConversationSpanEdge
ConversationSpanEdgeObject type. Edge type for conversation thread pagination.
| Field | Type | Description |
|---|---|---|
node | ConversationSpan! | The span |
cursor | String! | Cursor for this edge |
ConversationThreadResult
ConversationThreadResultObject type. Result of getConversationThread: LLM spans ordered as a conversation thread.
| Field | Type | Description |
|---|---|---|
edges | [ConversationSpanEdge!]! | Ordered list of LLM spans in the conversation |
pageInfo | TracePageInfo! | Pagination metadata |
turnErrors | [ConversationTurnError!]! | Aggregated per-turn error data keyed by trace ID |
warehouseQuery | String | SQL query sent to the warehouse to fetch prompts/completions (for debugging) |
ConversationTurnError
ConversationTurnErrorObject type. Aggregated error data for a single conversation turn (trace).
| Field | Type | Description |
|---|---|---|
traceId | String! | Trace ID (hex-encoded) |
errorCount | Int! | Number of error spans in the trace |
errorMessages | [String!]! | Deduplicated human-readable error messages for the trace |
GetConversationThreadInput
GetConversationThreadInputInput object type. Input for getConversationThread query.
| Field | Type | Description |
|---|---|---|
agentName | String! | Agent name |
traceTableMcon | String! | MCON of the trace table or platform agent (aiagent object type) |
conversationId | String! | Conversation ID to fetch the thread for |
startTime | DateTime! | Start of time range (inclusive) |
endTime | DateTime! | End of time range (inclusive) |
first | Int | Number of spans for forward pagination |
after | String | Cursor for forward pagination |
last | Int | Number of spans for backward pagination |
before | String | Cursor for backward pagination |
Related types
DateTime, GenericScalar, TracePageInfo
getConversationThreadV2 (query)
getConversationThreadV2 is a query in the Monte Carlo GraphQL API, in Agent traces and evaluations. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.
Status: Experimental
Get a structured conversation thread for the Conversations Details Page 2.0. Returns bounded message previews plus a snapshot ID that can be used to fetch full message content in chunks.
Arguments
| Argument | Type | Description |
|---|---|---|
input | GetConversationThreadV2Input! |
Returns
ConversationThreadV2Result
Example
query GetConversationThreadV2($input: GetConversationThreadV2Input!) {
getConversationThreadV2(input: $input) {
snapshotId
status
errorMessage
previewCharLimit
chunkCharSize
warehouseQuery
}
}Types used only by getConversationThreadV2
getConversationThreadV2ConversationMessageV2
ConversationMessageV2Object type. A single message summary in a conversation turn.
| Field | Type | Description |
|---|---|---|
messageId | String! | Opaque ID for chunk retrieval |
role | String! | Message role (user, assistant, tool, …) |
reasoning | ConversationReasoningV2 | Model reasoning, separate from the visible message. Null when absent. |
platformThoughtType | String | The platform's query-thought category, verbatim. Null for other messages. |
content | String! | Preview content for thread rendering; large messages are truncated |
contentLength | Int! | Character length of the full content |
contentComplete | Boolean! | Whether content contains the full message body or only a preview |
contentChunkCount | Int! | How many chunks are available via getConversationMessageContentV2 |
toolCalls | [ToolCallBlock!]! | Tool calls made in this message (assistant messages only) |
ConversationReasoningV2
ConversationReasoningV2Object type. A preview of a message's model reasoning.
| Field | Type | Description |
|---|---|---|
messageId | String! | Opaque ID for fetching the full reasoning via getConversationMessageContentV2 |
content | String! | Preview of the reasoning text |
contentLength | Int! | Character length of the reasoning |
contentComplete | Boolean! | Whether content contains the full reasoning or only a preview |
contentChunkCount | Int! | How many chunks are available via getConversationMessageContentV2 |
ConversationThreadV2Result
ConversationThreadV2ResultObject type. Result of getConversationThreadV2: async bounded thread summaries plus status.
| Field | Type | Description |
|---|---|---|
snapshotId | String! | Snapshot identifier used to fetch full message content chunks |
status | String! | Snapshot build status: QUEUED, PROCESSING, READY, or FAILED |
errorMessage | String | Error from the most recent snapshot build attempt, if any |
previewCharLimit | Int! | Preview size used in this response |
chunkCharSize | Int! | Chunk size used for message retrieval |
turns | [ConversationTurnV2!]! | Ordered list of conversation turns |
warehouseQuery | String | SQL query sent to the warehouse (for debugging) |
datasetBuilderPin | AgentDatasetBuilderPin | The conversation's live dataset builder pin. Null when it has none or the user lacks agent evaluation access. |
ConversationTurnV2
ConversationTurnV2Object type. One turn in a structured conversation — corresponds to one trace execution.
| Field | Type | Description |
|---|---|---|
traceId | String! | Trace ID (hex-encoded) |
turnIndex | Int! | Zero-based position of this turn in the conversation |
userName | String | End-user identifier supplied by the source platform for this turn. May be a username or an ID, such as a Databricks Genie user ID. Null when unavailable. |
roleName | String | End-user access role supplied by the source platform for this turn. Separate from a message's user or assistant role. Null when unavailable. |
platformConversationType | String | Conversation type the source platform reported, verbatim. Null when unavailable. |
agentVersion | String | Version of the agent this turn ran under, as the source platform stamped it on the turn's spans. For Snowflake Cortex this is the agent version name, such as VERSION$19, or LIVE for the unversioned working copy. Each turn carries its own value, so a conversation that spans versions reports every one. Null when the platform stamps no version. |
agentVersionAlias | String | Alias the source platform attached to the version this turn ran under, such as PRODUCTION. Null when no alias is set or the platform stamps no version. |
replyRecorded | Boolean | Whether the trace recorded the reply the user saw. False when the reply is a JSON object from an LLM call inside a Google ADK workflow code step, or when a code step ran without errors and neither an LLM call nor the agent's root span replied: the code may send the user a different reply that is not traced. Null when the trace store does not report it, on turns that stand for a failed trace, and on a turn that has only recorded text, no reply and no label. |
systemMessages | [ConversationMessageV2!]! | System prompts from the main chain, separated from the visible chat flow |
messages | [ConversationMessageV2!]! | Deduplicated non-system messages from the main conversation chain (repeated history from prior turns removed) |
internalSteps | [InternalStepGroupV2!]! | Non-main spans (internal agent steps) for this turn |
mainSpanMetrics | [MainSpanMetricsV2!]! | Metrics-only entries for this turn's main spans, ordered by span start time. The election usually lands on the LLM calls whose content renders in this turn's messages; it can also elect a Cortex turn wrapper or, when no span carries user-role prompts, a trailing tool-execution span (see isToolCall). When internalSteps are requested, the two lists partition the turn's tokens: step totalTokens plus mainSpanMetrics totalTokens sum to the turn's totalTokens. Empty for turns with no main spans (e.g. error-only turns). |
startTime | DateTime | Wall-clock start of this turn: the earliest LLM span start in the turn's trace, or the error timestamp for error-only turns (no LLM spans). Null when no start time is known. Turns are ordered by their trace's earliest activity, so a turn whose trace also has an earlier error span can report a start_time after a preceding turn's. |
durationSeconds | Float | Wall-clock duration of this turn in seconds, measured from the earliest span start to the latest span end across all LLM spans in the trace. Null when timing data is unavailable. |
promptTokens | Int | Total prompt (input) tokens consumed across all LLM spans in this turn. Null when token data is unavailable. |
completionTokens | Int | Total completion (output) tokens generated across all LLM spans in this turn. Null when token data is unavailable. |
totalTokens | Int | Total tokens (prompt + completion) across all LLM spans in this turn. Null when token data is unavailable. |
errorCount | Int! | Number of spans with OTel ERROR status in this turn |
errorMessages | [String!]! | Deduplicated human-readable error messages for this turn |
GetConversationThreadV2Input
GetConversationThreadV2InputInput object type. Input for getConversationThreadV2 query.
| Field | Type | Description |
|---|---|---|
agentName | String! | Agent name |
traceTableMcon | String! | MCON of the trace table or platform agent (aiagent object type) |
conversationId | String! | Conversation ID to fetch the thread for |
startTime | DateTime! | Start of time range (inclusive) |
endTime | DateTime! | End of time range (inclusive) |
previewCharLimit | Int | Maximum characters returned inline for each message preview. Defaults to 4000. Ignored when fullContent is true. |
chunkCharSize | Int | Chunk size used for full message retrieval. Defaults to 16000; capped at 200000 characters. Ignored when fullContent is true. |
includeInternalSteps | Boolean | Whether to include internal step summaries in the response. Defaults to false. |
lazyToolIo | Boolean | Whether tool-call input/output may be returned lazily. Defaults to false so existing machine consumers continue to receive complete tool payloads inline. Default: false. |
fullContent | Boolean | Return every message and tool call complete, for batch readers such as the reinforcement loop. Monte Carlo-hosted agents are read in one warehouse read. The result is never cached, so getConversationMessageContentV2 returns null for its snapshotId. The status is FAILED when the conversation is too large or some of its content could not be loaded; read it without fullContent instead. Defaults to false. Default: false. |
timeoutSeconds | Int | Optional warehouse statement-timeout budget (seconds) for hydrating span content. Omit to use the standard default; heavy batch reads may raise it up to 170s (clamped server-side). Synchronous ClickHouse reads share a 20s request budget; idempotent requests return PROCESSING when another poll is needed. |
InternalStepGroupV2
InternalStepGroupV2Object type. Messages from a span that is not part of the main conversation chain.
Examples: internal classification calls, title generation, suggestion
generation — these run alongside the main chat flow.
| Field | Type | Description |
|---|---|---|
spanId | String! | Span ID (hex-encoded) |
spanName | String | Span name |
isToolCall | Boolean! | True when the underlying span is a tool execution. Lets the UI render tool steps (e.g. a Cortex CortexAnalystTool_* call or a langgraph tool span) distinctly from internal LLM steps. |
messages | [ConversationMessageV2!]! | Messages from this internal span. Repeats are removed, except on Cortex reasoning steps, which keep every message. |
startTime | DateTime | Start time of the step's underlying span. Null for synthesized steps with no underlying span or when the span has no start time. |
endTime | DateTime | End time of the step's underlying span. Null for in-flight spans and synthesized steps with no underlying span. |
durationSeconds | Float | Duration of the step's underlying span in seconds (end minus start). Null when either time is missing or the end precedes the start. |
promptTokens | Int | Number of prompt tokens on the step's underlying span |
completionTokens | Int | Number of completion tokens on the step's underlying span |
totalTokens | Int | Total tokens (prompt + completion) on the step's underlying span. Steps cover only non-main spans. When internalSteps are requested, step totalTokens plus the turn's mainSpanMetrics totalTokens sum to the turn's totalTokens. |
cacheReadTokens | Int | Input tokens the step's underlying span served from the prompt cache. Set on Snowflake Cortex planning, response-generation, and suggested-query steps, where promptTokens excludes them, so promptTokens plus cacheReadTokens is the step's full input. Not part of totalTokens. |
status | Int | OTel status code of the step's underlying span (0=unset, 1=ok, 2=error). Null for synthesized steps with no underlying span, and when the span carries no status. |
model | String | Model recorded on the step's underlying span. Null for synthesized steps with no underlying span, and when the span records no model. |
MainSpanMetricsV2
MainSpanMetricsV2Object type. Metrics for one of the turn's main spans — the spans whose content
renders in this turn's messages.
The span's content is already rendered in the turn's messages; this carries
only its per-span metrics. A main span is usually an LLM call, but can be a
Cortex turn wrapper or — when no span carries user-role prompts — a
trailing tool-execution span (see isToolCall).
| Field | Type | Description |
|---|---|---|
spanId | String! | Span ID (hex-encoded) |
spanName | String | Span name |
isToolCall | Boolean! | True when the main span is a tool execution rather than an LLM call. The election falls back to a tool span when no span in the turn carries user-role prompts. |
startTime | DateTime | Start time of the call's underlying span. Null when the span has no start time. |
endTime | DateTime | End time of the call's underlying span. Null for in-flight spans. |
durationSeconds | Float | Duration of the call's underlying span in seconds (end minus start). Null when either time is missing or the end precedes the start. |
promptTokens | Int | Number of prompt tokens on the call's underlying span |
completionTokens | Int | Number of completion tokens on the call's underlying span |
totalTokens | Int | Total tokens (prompt + completion) on the call's underlying span. When internalSteps are requested, a turn's internalSteps totalTokens plus its mainSpanMetrics totalTokens sum to the turn's totalTokens. |
status | Int | OTel status code of the call's underlying span (0=unset, 1=ok, 2=error); null when the span carries no status |
model | String | Model recorded on the call's underlying span. Null when the span records no model. |
ToolCallBlock
ToolCallBlockObject type. A tool call — usually extracted from an inline tool_use content block, but also
synthesized for column-carried tool-call steps (Cortex/Genie/OTel/MLflow) whose I/O
arrives on the tool_call_input/tool_call_output columns.
| Field | Type | Description |
|---|---|---|
name | String! | Tool name |
inputJson | String! | The tool's input, always as valid JSON: an object/array for tools with structured input (inline tool_use calls), or a JSON string for tools whose input is raw text (e.g. a SQL string for Cortex/Genie SQL tools). Consumers can JSON-decode it unconditionally. When inputComplete is false this is {}. If inputUnavailableReason is null, fetch the full input with getConversationToolCallContentV2 using spanId. |
outputJson | String | The tool's output, for tool steps that carry it on the tool_call_output column (Cortex/Genie/OTel/MLflow tool steps), always as valid JSON: an object/array for structured output, or a JSON string for raw text. Null for inline tool_use calls, whose output is conveyed on the paired tool-role message. An answered ask_user call carries its answer payload here instead. Also null when outputComplete is false; if outputUnavailableReason is null, fetch the full output with getConversationToolCallContentV2 using spanId. Lazy outputs have no paired tool-role message. Non-null values can be JSON-decoded unconditionally. |
toolUseId | String | Unique ID for this tool call (if available) |
spanId | String | Span ID used to fetch input or output when the corresponding field is incomplete |
inputLength | Int | Known tool input length in Unicode code points, from the declared source length or rendered inline payload length; null when unavailable. |
outputLength | Int | Known tool output length in Unicode code points, from the declared source length or rendered inline payload length; null when unavailable. |
inputComplete | Boolean! | Whether inputJson contains the full tool input |
outputComplete | Boolean! | Whether outputJson contains the full tool output |
inputUnavailableReason | String | Error code when the input cannot be safely loaded; null otherwise. CONVERSATION_TOOL_CONTENT_FILTER_BOUNDARY: withheld at a content-filter boundary. CONVERSATION_TOOL_CONTENT_EXPORT_TRUNCATED: the trace export capped the input, so only a partial prefix is available. |
outputUnavailableReason | String | Error code when the output cannot be safely loaded; null otherwise. CONVERSATION_TOOL_CONTENT_FILTER_BOUNDARY: withheld at a content-filter boundary. CONVERSATION_TOOL_CONTENT_EXPORT_TRUNCATED: the trace export capped the output, so only a partial prefix is available. |
Related types
AgentDatasetBuilderPin, DateTime
getConversationTimeSeries (query)
getConversationTimeSeries is a query in the Monte Carlo GraphQL API, in Agent traces and evaluations. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.
Status: Experimental
Conversation metrics by the first matching turn's bucket. Each conversation counts once per series. End time is excluded. Filters and segment values select traces before conversation grouping; metrics use only matching turns. Supports MODEL, WORKFLOW, and TASK segments, with one series per observed value. Empty segment values returns every value. Gaps have null values.
Arguments
| Argument | Type | Description |
|---|---|---|
input | GetConversationTimeSeriesInput! | Conversation window, bucket size, metrics, and trace filters |
Returns
[ConversationTimeSeriesType!]!
Example
query GetConversationTimeSeries($input: GetConversationTimeSeriesInput!) {
getConversationTimeSeries(input: $input) {
metric
segment
}
}Types used only by getConversationTimeSeries
getConversationTimeSeriesConversationMetricGroup
ConversationMetricGroupEnum type. The metric set one dashboard tile requests.
| Value | Description |
|---|---|
COUNT | |
DURATION | |
TOKENS | |
ERRORS |
ConversationTimeSeriesMetric
ConversationTimeSeriesMetricEnum type.
| Value | Description |
|---|---|
CONVERSATION_COUNT | |
DURATION_AVG | |
DURATION_P50 | |
DURATION_P95 | |
TOTAL_TOKENS | |
ERRORED_CONVERSATIONS | |
ERROR_RATE |
ConversationTimeSeriesType
ConversationTimeSeriesTypeObject type. One metric and segment, with each conversation assigned to its first matching turn.
| Field | Type | Description |
|---|---|---|
metric | ConversationTimeSeriesMetric! | The conversation metric. Durations include idle time between matching turns in the window, in seconds. ERROR_RATE is a percentage from 0 to 100. TOTAL_TOKENS sums turn token counts; null means no token data, including on platforms that do not report tokens. Zero means zero tokens. |
segment | String | The MODEL, WORKFLOW, or TASK value represented by this series. Null for an unsegmented series. A conversation appears under every value its turns carry. |
buckets | [TraceTimeSeriesBucketType!]! | Buckets in time order. A conversation counts once, in the bucket of its first matching turn. Empty buckets have null values. An errored conversation has an errored root span in a matching turn; child-span errors alone do not count. |
GetConversationTimeSeriesInput
GetConversationTimeSeriesInputInput object type. Conversation series over traces selected before conversation grouping.
| Field | Type | Description |
|---|---|---|
agentName | String! | Agent name to filter by |
traceTableMcon | String! | MCON of the trace table or platform agent to query |
startTime | DateTime! | Start of the window, inclusive |
endTime | DateTime! | End of the window, exclusive |
bucketSize | TraceBucketSize! | Bucket size: MINUTE, HOUR, DAY, or WEEK. A conversation counts once, in the bucket of its first matching turn. |
metricGroup | ConversationMetricGroup | COUNT returns conversation count; DURATION returns avg/p50/p95 wall-clock seconds, including idle time between matching turns in the window; TOKENS returns summed turn tokens; ERRORS returns errored conversations and error rate as a percentage from 0 to 100. Token values are null on platforms without token counts and when no conversation has token data. Zero means zero tokens. Deprecated: use metricGroups instead. |
metricGroups | [ConversationMetricGroup!] | Metric groups to return, in order, with duplicate metrics returned once. Provide a non-empty list or metricGroup, exclusively. COUNT returns conversation count; DURATION returns avg/p50/p95 wall-clock seconds; TOKENS returns summed turn tokens; ERRORS returns errored conversations and error rate as a percentage from 0 to 100. |
filters | TraceFiltersInput | Select traces before grouping into conversations. Metrics use only matching turns. |
segmentFilter | TraceSegmentFilterInput | Group by MODEL, WORKFLOW, or TASK, with one series per value. Select traces for each value before grouping into conversations. Metrics use only matching turns. A conversation appears under every value its turns carry. Empty values returns every value. Omitted or null returns unsegmented series. |
Related types
DateTime, TraceBucketSize, TraceFiltersInput, TraceSegmentFilterInput, TraceTimeSeriesBucketType
getConversationToolCallContentV2 (query)
getConversationToolCallContentV2 is a query in the Monte Carlo GraphQL API, in Agent traces and evaluations. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.
Status: Experimental
Fetch a bounded input or output slice for a tool call in a cached conversation-thread V2 snapshot.
Arguments
| Argument | Type | Description |
|---|---|---|
input | GetConversationToolCallContentV2Input! |
Returns
ConversationToolCallContentChunkV2
Example
query GetConversationToolCallContentV2($input: GetConversationToolCallContentV2Input!) {
getConversationToolCallContentV2(input: $input) {
status
content
contentLength
offset
nextOffset
complete
}
}Types used only by getConversationToolCallContentV2
getConversationToolCallContentV2ConversationToolCallContentChunkV2
ConversationToolCallContentChunkV2Object type. A bounded slice of tool-call input or output.
| Field | Type | Description |
|---|---|---|
status | String! | Content status: PROCESSING or READY |
content | String | Filtered content slice; null while processing |
contentLength | Int! | Full source length in Unicode code points before filtering |
offset | Int! | Zero-based source offset of this slice |
nextOffset | Int! | Next source offset to request; unchanged while processing. Filtering can change the returned text length. |
complete | Boolean! | Whether this slice reaches the end of the field |
ConversationToolCallContentField
ConversationToolCallContentFieldEnum type. Tool-call content field available for lazy retrieval.
| Value | Description |
|---|---|
INPUT | |
OUTPUT |
GetConversationToolCallContentV2Input
GetConversationToolCallContentV2InputInput object type. Input for getConversationToolCallContentV2.
| Field | Type | Description |
|---|---|---|
snapshotId | String! | Snapshot ID from the thread query |
traceId | String! | Trace ID containing the tool call |
spanId | String! | Tool-call span ID from the thread snapshot |
field | ConversationToolCallContentField! | Tool input or output |
offset | Int! | Zero-based source offset in Unicode code points before filtering |
length | Int! | Requested source character count before filtering. The server reads at most 65536 characters. |
getGenieSpaceConfiguration (query)
getGenieSpaceConfiguration is a query in the Monte Carlo GraphQL API, in Agent traces and evaluations. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.
Status: Experimental
A Databricks Genie agent's space configuration, read live through its collector connection. Monte Carlo internal and system users only. Errors carry extensions.code: GENIE_SPACE_MISSING_GRANT (with the principal and remediation in extensions), DATABRICKS_CREDENTIALS_REJECTED, REQUEST_TIMEOUT, GENIE_SPACE_CONFIGURATION_UNAVAILABLE, VALIDATION_ERROR, or FAILED_AUTHORIZATION.
Arguments
| Argument | Type | Description |
|---|---|---|
agentName | String! | The Genie agent's name, which is its space id. |
traceTableMcon | String! | MCON of the agent's trace table — same value passed as traceTableMcon on getAgentGraph. |
Returns
GenieSpaceConfiguration!
Example
query GetGenieSpaceConfiguration($agentName: String!, $traceTableMcon: String!) {
getGenieSpaceConfiguration(agentName: $agentName, traceTableMcon: $traceTableMcon) {
spaceId
serializedSpace
etag
title
description
warehouseId
}
}Types used only by getGenieSpaceConfiguration
getGenieSpaceConfigurationGenieSpaceConfiguration
GenieSpaceConfigurationObject type. A Databricks Genie space's configuration, read live from the workspace.
| Field | Type | Description |
|---|---|---|
spaceId | String! | The Genie space id. |
serializedSpace | String! | The space's configuration as the JSON string Databricks returns, unchanged: tables, instructions, example SQL, SQL functions and benchmarks. |
etag | String | Opaque version token. It changes when the space's configuration changes. |
title | String | The space's title. |
description | String | The space's description. |
warehouseId | String | The SQL warehouse the space runs on. |
getGoldenBaseline (query)
getGoldenBaseline is a query in the Monte Carlo GraphQL API, in Agent traces and evaluations. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.
Status: Experimental
Fetch a golden set's current baseline (with is_stale), or null if none.
Arguments
| Argument | Type | Description |
|---|---|---|
setUuid | UUID! | Set whose baseline to fetch. |
Returns
Example
query GetGoldenBaseline($setUuid: UUID!) {
getGoldenBaseline(setUuid: $setUuid) {
uuid
status
summary
isStale
targetRef
agentConfigSnapshot
createdTime
updatedTime
}
}Related types
getGoldenSet (query)
getGoldenSet is a query in the Monte Carlo GraphQL API, in Agent traces and evaluations. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.
Status: Experimental
Fetch one golden set by uuid.
Arguments
| Argument | Type | Description |
|---|---|---|
setUuid | UUID! | Set to fetch. |
Returns
Example
query GetGoldenSet($setUuid: UUID!) {
getGoldenSet(setUuid: $setUuid) {
uuid
name
agentName
traceTableMcon
prodTargetPath
devTargetPath
evalConfig
retentionDays
testCaseCount
lastUsedAt
expiresAt
createdTime
updatedTime
}
}Related types
getGoldenSets (query)
getGoldenSets is a query in the Monte Carlo GraphQL API, in Agent traces and evaluations. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.
Status: Experimental
List the account's golden sets. Pass agentName + traceTableMcon together to scope to one agent; omit both for the full account list.
Arguments
| Argument | Type | Description |
|---|---|---|
agentName | String | Scope to sets bound to this observability agent (with traceTableMcon). |
traceTableMcon | String | MCON of the agent's trace table; pair with agentName to scope by agent. |
Returns
[GoldenSet!]!
Example
query GetGoldenSets {
getGoldenSets {
uuid
name
agentName
traceTableMcon
prodTargetPath
devTargetPath
evalConfig
retentionDays
testCaseCount
lastUsedAt
expiresAt
createdTime
updatedTime
}
}Related types
getGoldenTestCases (query)
getGoldenTestCases is a query in the Monte Carlo GraphQL API, in Agent traces and evaluations. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.
Status: Experimental
List a golden set's test cases.
Arguments
| Argument | Type | Description |
|---|---|---|
setUuid | UUID! | Set whose test cases to list. |
Returns
[GoldenTestCase!]!
Example
query GetGoldenTestCases($setUuid: UUID!) {
getGoldenTestCases(setUuid: $setUuid) {
uuid
userInput
isMultiTurn
contextTurnCount
hasReference
targetResponseCaptured
targetTurnIndex
sourceConversationId
sourceTraceId
sourceAgedOut
createdTime
}
}Related types
getGoldenTestRuns (query)
getGoldenTestRuns is a query in the Monte Carlo GraphQL API, in Agent traces and evaluations. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.
Status: Experimental
List a golden set's test runs, newest first.
Arguments
| Argument | Type | Description |
|---|---|---|
setUuid | UUID! | Set whose test runs to list. |
Returns
[GoldenTestRun!]!
Example
query GetGoldenTestRuns($setUuid: UUID!) {
getGoldenTestRuns(setUuid: $setUuid) {
uuid
status
comparedBaselineUuid
targetRef
baselineStale
createdTime
updatedTime
agentConfigSnapshot
}
}Related types
getLinearIntegration (query)
getLinearIntegration is a query in the Monte Carlo GraphQL API, in Agent traces and evaluations. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.
Status: Experimental
The account's configured Linear integration. Returns null when Linear is not configured for the account.
Returns
Example
query GetLinearIntegration {
getLinearIntegration {
uuid
webhookUrl
webhookEnabled
defaultTeamId
integrationName
}
}Related types
getLinearTeams (query)
getLinearTeams is a query in the Monte Carlo GraphQL API, in Agent traces and evaluations. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.
Status: Experimental
Linear teams available via the account's configured integration — use a team's id as defaultTeamId (configureLinearIntegration) or teamId (createLinearTicketForAgentHealthIssue). Errors if no integration is configured.
Returns
[LinearTeam!]!
Example
query GetLinearTeams {
getLinearTeams {
id
name
key
}
}Types used only by getLinearTeams
getLinearTeamsLinearTeam
LinearTeamObject type. A Linear team available via the account's configured integration.
| Field | Type | Description |
|---|---|---|
id | String! | Linear team ID — pass as defaultTeamId or a ticket's teamId. |
name | String! | Team display name. |
key | String! | Team key (e.g. ENG). |
Source: The GraphQL API reference
This page is generated from the GraphQL schema on each release. Changes made in ReadMe are overwritten.
