Agent traces, part 3 of 7 (GraphQL)

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

ArgumentTypeDescription
inputGetConversationsInput!

Returns

ConversationsResult

Example

query GetConversations($input: GetConversationsInput!) {
  getConversations(input: $input) {
    clusterContentWithheldReason
    totalCount
  }
}

Types used only by getConversations

ClusterAssignmentType

Object type. One of possibly several clusters assigned to a conversation by its most recent classification run, in the current taxonomy.

FieldTypeDescription
clusterKeyString!Assigned cluster slug; "uncategorized" if gated / no match.
clusterNameString!Display name of the assigned cluster.
confidenceFloat!Classifier self-reported confidence for the assignment.
Conversation

Object type. A conversation groups one or more agent traces sharing the same conversation_id.

FieldTypeDescription
conversationIdString!Conversation identifier
turnsInt!Number of traces (runs) in this conversation
totalTokensIntSum of tokens across all traces in the conversation
startTimeDateTime!Earliest trace start time in the conversation
endTimeDateTime!Latest trace end time in the conversation
durationSecondsFloat!Total conversation duration in seconds (end_time - start_time)
activeDurationSecondsFloat!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.
statusConversationStatus!ERROR if any trace had a root span error, otherwise OK
errorsCountInt!Number of spans across all traces in this conversation that errored (excluding LangGraph GraphInterrupt sentinels).
erroredTurnsInt!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.
intentClusterClusterAssignmentTypeDeprecated 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.
feedbackConversationFeedbackCountsEnd-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

Object 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.

FieldTypeDescription
monitorUuidUUID!The evaluation monitor that produced this score
evalTypeString!The scored dimension (e.g. task_completion_score, helpfulness_score)
scoreFloat!Numeric score for the dimension
reasoningStringThe judge's short explanation for the score
scoredAtDateTime!When this score was produced
ConversationFeedbackCounts

Object 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.

FieldTypeDescription
positiveInt!
negativeInt!
unratedInt!Turns whose feedback has no rating
withCommentInt!Turns whose newest feedback carries a comment, at any rating
ConversationFiltersInput

Input object type. Filters for the getConversations query.

FieldTypeDescription
conversationIdSearchStringCase-insensitive substring search on conversation_id
traceIdStringFilter 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.
workflowAgentStringScope 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.
minTurnsIntMinimum number of turns (inclusive)
maxTurnsIntMaximum number of turns (inclusive)
minTotalTokensIntMinimum total tokens (inclusive)
maxTotalTokensIntMaximum total tokens (inclusive)
minCostFloatMinimum 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.
maxCostFloatMaximum token cost of a conversation, in the same costUnit
minQueryCostFloatMinimum 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.
maxQueryCostFloatMaximum query cost of a conversation, in the same costUnit
minTotalCostFloatMinimum 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.
maxTotalCostFloatMaximum total cost of a conversation, in the same costUnit
minDurationFloatMinimum conversation duration in seconds
maxDurationFloatMaximum conversation duration in seconds
minActiveDurationFloatMinimum active (processing) duration in seconds — sum of per-turn processing time, excluding idle gaps between turns
maxActiveDurationFloatMaximum 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.
runUuidUUIDFilter 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

Enum type. Fields that can be used for sorting conversations.

ValueDescription
CONVERSATION_ID
START_TIME
END_TIME
DURATION_SECONDS
ACTIVE_DURATION_SECONDS
TURNS
TOTAL_TOKENS
STATUS
EVAL_SCORE
EVAL_SCORES_COUNT
NEGATIVE_FEEDBACK_COUNT
ConversationStatus

Enum type. Status of a conversation derived from root span errors.

ValueDescription
OK
ERROR
ConversationsResult

Object type. Result of the getConversations query.

FieldTypeDescription
clusterContentWithheldReasonRawContentWithheldReasonWhy cluster assignments were withheld, or null when they were not.
conversations[Conversation!]!Conversations for the current page
pageInfoTracePageInfo!Pagination metadata
totalCountIntTotal 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

Input object type. Input parameters for the getConversations query.

FieldTypeDescription
agentNameString!Agent name to filter by
traceTableMconString!MCON of the trace table or platform agent (aiagent object type) to query
startTimeDateTime!Start of time range (inclusive)
endTimeDateTime!End of time range (inclusive)
filtersConversationFiltersInputOptional filters
clusteringSpaceUuidUUIDClustering 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.
firstIntNumber of conversations to fetch (forward pagination)
afterStringCursor for forward pagination
lastIntNumber of conversations to fetch (backward pagination)
beforeStringCursor for backward pagination
sortFieldConversationSortFieldField 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".
sortDirectionTraceSortDirectionSort direction (default: DESC) Default: "DESC".
sortEvalTypeStringThe 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.
sortEvalMonitorUuidUUIDThe 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

Enum 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.

ValueDescription
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

ConversationFilter

Object 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.

FieldTypeDescription
fieldNameConversationFilterFieldName!
displayNameString!
queryParameterNameString!Corresponding parameter name(s) in ConversationFiltersInput
queryParameterAcceptsMultipleValuesBoolean!Whether the associated getConversations parameter accepts multiple values as input
isRangeFilterBoolean!True → render as a min/max slider; False → render as checkboxes
facetSearchableBoolean!Whether the filter values can be searched by their display name

Related types

ConversationFilterFieldName

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

ArgumentTypeDescription
inputGetConversationsFiltersDataInput!

Returns

[ConversationFilterData!]!

Example

query GetConversationsFiltersData($input: GetConversationsFiltersDataInput!) {
  getConversationsFiltersData(input: $input) {
    fieldName
    minValue
    maxValue
  }
}

Types used only by getConversationsFiltersData

ConversationFilterData

Object 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.

FieldTypeDescription
fieldNameConversationFilterFieldName!
minValueFloatMinimum value (range filters only)
maxValueFloatMaximum value (range filters only)
values[ConversationFilterValue!]Available values (enum filters only)
ConversationFilterValue

Object type. A single value available for an enum conversation filter.

FieldTypeDescription
valueString!Raw value (e.g. 'OK', 'ERROR')
displayNameString!Human-readable label
countInt!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

ArgumentTypeDescription
inputGetConversationThreadInput!

Returns

ConversationThreadResult

Example

query GetConversationThread($input: GetConversationThreadInput!) {
  getConversationThread(input: $input) {
    warehouseQuery
  }
}

Types used only by getConversationThread

ConversationSpan

Object type. A single span in a conversation thread (is_tool_call, has_prompts, or has_completions).

FieldTypeDescription
spanIdString!Span ID (hex-encoded)
traceIdString!Trace ID (hex-encoded)
nameString!Span name
modelStringLLM model used
startTimeDateTime!Span start time
endTimeDateTime!Span end time
durationSecondsFloat!Span duration in seconds
promptTokensIntNumber of prompt tokens
completionTokensIntNumber of completion tokens
totalTokensIntTotal tokens (prompt + completion)
isToolCallBooleanWhether span represents a tool call
statusIntOTel status code (0=unset, 1=ok, 2=error); null when the span carries no status
promptsGenericScalarRaw prompt messages JSON string fetched from the warehouse
completionsGenericScalarRaw completion messages JSON string fetched from the warehouse
ConversationSpanEdge

Object type. Edge type for conversation thread pagination.

FieldTypeDescription
nodeConversationSpan!The span
cursorString!Cursor for this edge
ConversationThreadResult

Object type. Result of getConversationThread: LLM spans ordered as a conversation thread.

FieldTypeDescription
edges[ConversationSpanEdge!]!Ordered list of LLM spans in the conversation
pageInfoTracePageInfo!Pagination metadata
turnErrors[ConversationTurnError!]!Aggregated per-turn error data keyed by trace ID
warehouseQueryStringSQL query sent to the warehouse to fetch prompts/completions (for debugging)
ConversationTurnError

Object type. Aggregated error data for a single conversation turn (trace).

FieldTypeDescription
traceIdString!Trace ID (hex-encoded)
errorCountInt!Number of error spans in the trace
errorMessages[String!]!Deduplicated human-readable error messages for the trace
GetConversationThreadInput

Input object type. Input for getConversationThread query.

FieldTypeDescription
agentNameString!Agent name
traceTableMconString!MCON of the trace table or platform agent (aiagent object type)
conversationIdString!Conversation ID to fetch the thread for
startTimeDateTime!Start of time range (inclusive)
endTimeDateTime!End of time range (inclusive)
firstIntNumber of spans for forward pagination
afterStringCursor for forward pagination
lastIntNumber of spans for backward pagination
beforeStringCursor 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

ArgumentTypeDescription
inputGetConversationThreadV2Input!

Returns

ConversationThreadV2Result

Example

query GetConversationThreadV2($input: GetConversationThreadV2Input!) {
  getConversationThreadV2(input: $input) {
    snapshotId
    status
    errorMessage
    previewCharLimit
    chunkCharSize
    warehouseQuery
  }
}

Types used only by getConversationThreadV2

ConversationMessageV2

Object type. A single message summary in a conversation turn.

FieldTypeDescription
messageIdString!Opaque ID for chunk retrieval
roleString!Message role (user, assistant, tool, …)
reasoningConversationReasoningV2Model reasoning, separate from the visible message. Null when absent.
platformThoughtTypeStringThe platform's query-thought category, verbatim. Null for other messages.
contentString!Preview content for thread rendering; large messages are truncated
contentLengthInt!Character length of the full content
contentCompleteBoolean!Whether content contains the full message body or only a preview
contentChunkCountInt!How many chunks are available via getConversationMessageContentV2
toolCalls[ToolCallBlock!]!Tool calls made in this message (assistant messages only)
ConversationReasoningV2

Object type. A preview of a message's model reasoning.

FieldTypeDescription
messageIdString!Opaque ID for fetching the full reasoning via getConversationMessageContentV2
contentString!Preview of the reasoning text
contentLengthInt!Character length of the reasoning
contentCompleteBoolean!Whether content contains the full reasoning or only a preview
contentChunkCountInt!How many chunks are available via getConversationMessageContentV2
ConversationThreadV2Result

Object type. Result of getConversationThreadV2: async bounded thread summaries plus status.

FieldTypeDescription
snapshotIdString!Snapshot identifier used to fetch full message content chunks
statusString!Snapshot build status: QUEUED, PROCESSING, READY, or FAILED
errorMessageStringError from the most recent snapshot build attempt, if any
previewCharLimitInt!Preview size used in this response
chunkCharSizeInt!Chunk size used for message retrieval
turns[ConversationTurnV2!]!Ordered list of conversation turns
warehouseQueryStringSQL query sent to the warehouse (for debugging)
datasetBuilderPinAgentDatasetBuilderPinThe conversation's live dataset builder pin. Null when it has none or the user lacks agent evaluation access.
ConversationTurnV2

Object type. One turn in a structured conversation — corresponds to one trace execution.

FieldTypeDescription
traceIdString!Trace ID (hex-encoded)
turnIndexInt!Zero-based position of this turn in the conversation
userNameStringEnd-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.
roleNameStringEnd-user access role supplied by the source platform for this turn. Separate from a message's user or assistant role. Null when unavailable.
platformConversationTypeStringConversation type the source platform reported, verbatim. Null when unavailable.
agentVersionStringVersion 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.
agentVersionAliasStringAlias 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.
replyRecordedBooleanWhether 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).
startTimeDateTimeWall-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.
durationSecondsFloatWall-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.
promptTokensIntTotal prompt (input) tokens consumed across all LLM spans in this turn. Null when token data is unavailable.
completionTokensIntTotal completion (output) tokens generated across all LLM spans in this turn. Null when token data is unavailable.
totalTokensIntTotal tokens (prompt + completion) across all LLM spans in this turn. Null when token data is unavailable.
errorCountInt!Number of spans with OTel ERROR status in this turn
errorMessages[String!]!Deduplicated human-readable error messages for this turn
GetConversationThreadV2Input

Input object type. Input for getConversationThreadV2 query.

FieldTypeDescription
agentNameString!Agent name
traceTableMconString!MCON of the trace table or platform agent (aiagent object type)
conversationIdString!Conversation ID to fetch the thread for
startTimeDateTime!Start of time range (inclusive)
endTimeDateTime!End of time range (inclusive)
previewCharLimitIntMaximum characters returned inline for each message preview. Defaults to 4000. Ignored when fullContent is true.
chunkCharSizeIntChunk size used for full message retrieval. Defaults to 16000; capped at 200000 characters. Ignored when fullContent is true.
includeInternalStepsBooleanWhether to include internal step summaries in the response. Defaults to false.
lazyToolIoBooleanWhether tool-call input/output may be returned lazily. Defaults to false so existing machine consumers continue to receive complete tool payloads inline. Default: false.
fullContentBooleanReturn 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.
timeoutSecondsIntOptional 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

Object 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.

FieldTypeDescription
spanIdString!Span ID (hex-encoded)
spanNameStringSpan name
isToolCallBoolean!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.
startTimeDateTimeStart time of the step's underlying span. Null for synthesized steps with no underlying span or when the span has no start time.
endTimeDateTimeEnd time of the step's underlying span. Null for in-flight spans and synthesized steps with no underlying span.
durationSecondsFloatDuration of the step's underlying span in seconds (end minus start). Null when either time is missing or the end precedes the start.
promptTokensIntNumber of prompt tokens on the step's underlying span
completionTokensIntNumber of completion tokens on the step's underlying span
totalTokensIntTotal 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.
cacheReadTokensIntInput 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.
statusIntOTel 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.
modelStringModel recorded on the step's underlying span. Null for synthesized steps with no underlying span, and when the span records no model.
MainSpanMetricsV2

Object 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).

FieldTypeDescription
spanIdString!Span ID (hex-encoded)
spanNameStringSpan name
isToolCallBoolean!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.
startTimeDateTimeStart time of the call's underlying span. Null when the span has no start time.
endTimeDateTimeEnd time of the call's underlying span. Null for in-flight spans.
durationSecondsFloatDuration of the call's underlying span in seconds (end minus start). Null when either time is missing or the end precedes the start.
promptTokensIntNumber of prompt tokens on the call's underlying span
completionTokensIntNumber of completion tokens on the call's underlying span
totalTokensIntTotal 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.
statusIntOTel status code of the call's underlying span (0=unset, 1=ok, 2=error); null when the span carries no status
modelStringModel recorded on the call's underlying span. Null when the span records no model.
ToolCallBlock

Object 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.

FieldTypeDescription
nameString!Tool name
inputJsonString!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.
outputJsonStringThe 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.
toolUseIdStringUnique ID for this tool call (if available)
spanIdStringSpan ID used to fetch input or output when the corresponding field is incomplete
inputLengthIntKnown tool input length in Unicode code points, from the declared source length or rendered inline payload length; null when unavailable.
outputLengthIntKnown tool output length in Unicode code points, from the declared source length or rendered inline payload length; null when unavailable.
inputCompleteBoolean!Whether inputJson contains the full tool input
outputCompleteBoolean!Whether outputJson contains the full tool output
inputUnavailableReasonStringError 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.
outputUnavailableReasonStringError 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

ArgumentTypeDescription
inputGetConversationTimeSeriesInput!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

ConversationMetricGroup

Enum type. The metric set one dashboard tile requests.

ValueDescription
COUNT
DURATION
TOKENS
ERRORS
ConversationTimeSeriesMetric

Enum type.

ValueDescription
CONVERSATION_COUNT
DURATION_AVG
DURATION_P50
DURATION_P95
TOTAL_TOKENS
ERRORED_CONVERSATIONS
ERROR_RATE
ConversationTimeSeriesType

Object type. One metric and segment, with each conversation assigned to its first matching turn.

FieldTypeDescription
metricConversationTimeSeriesMetric!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.
segmentStringThe 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

Input object type. Conversation series over traces selected before conversation grouping.

FieldTypeDescription
agentNameString!Agent name to filter by
traceTableMconString!MCON of the trace table or platform agent to query
startTimeDateTime!Start of the window, inclusive
endTimeDateTime!End of the window, exclusive
bucketSizeTraceBucketSize!Bucket size: MINUTE, HOUR, DAY, or WEEK. A conversation counts once, in the bucket of its first matching turn.
metricGroupConversationMetricGroupCOUNT 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.
filtersTraceFiltersInputSelect traces before grouping into conversations. Metrics use only matching turns.
segmentFilterTraceSegmentFilterInputGroup 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

ArgumentTypeDescription
inputGetConversationToolCallContentV2Input!

Returns

ConversationToolCallContentChunkV2

Example

query GetConversationToolCallContentV2($input: GetConversationToolCallContentV2Input!) {
  getConversationToolCallContentV2(input: $input) {
    status
    content
    contentLength
    offset
    nextOffset
    complete
  }
}

Types used only by getConversationToolCallContentV2

ConversationToolCallContentChunkV2

Object type. A bounded slice of tool-call input or output.

FieldTypeDescription
statusString!Content status: PROCESSING or READY
contentStringFiltered content slice; null while processing
contentLengthInt!Full source length in Unicode code points before filtering
offsetInt!Zero-based source offset of this slice
nextOffsetInt!Next source offset to request; unchanged while processing. Filtering can change the returned text length.
completeBoolean!Whether this slice reaches the end of the field
ConversationToolCallContentField

Enum type. Tool-call content field available for lazy retrieval.

ValueDescription
INPUT
OUTPUT
GetConversationToolCallContentV2Input

Input object type. Input for getConversationToolCallContentV2.

FieldTypeDescription
snapshotIdString!Snapshot ID from the thread query
traceIdString!Trace ID containing the tool call
spanIdString!Tool-call span ID from the thread snapshot
fieldConversationToolCallContentField!Tool input or output
offsetInt!Zero-based source offset in Unicode code points before filtering
lengthInt!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

ArgumentTypeDescription
agentNameString!The Genie agent's name, which is its space id.
traceTableMconString!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

GenieSpaceConfiguration

Object type. A Databricks Genie space's configuration, read live from the workspace.

FieldTypeDescription
spaceIdString!The Genie space id.
serializedSpaceString!The space's configuration as the JSON string Databricks returns, unchanged: tables, instructions, example SQL, SQL functions and benchmarks.
etagStringOpaque version token. It changes when the space's configuration changes.
titleStringThe space's title.
descriptionStringThe space's description.
warehouseIdStringThe 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

ArgumentTypeDescription
setUuidUUID!Set whose baseline to fetch.

Returns

GoldenBaseline

Example

query GetGoldenBaseline($setUuid: UUID!) {
  getGoldenBaseline(setUuid: $setUuid) {
    uuid
    status
    summary
    isStale
    targetRef
    agentConfigSnapshot
    createdTime
    updatedTime
  }
}

Related types

GoldenBaseline, UUID

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

ArgumentTypeDescription
setUuidUUID!Set to fetch.

Returns

GoldenSet

Example

query GetGoldenSet($setUuid: UUID!) {
  getGoldenSet(setUuid: $setUuid) {
    uuid
    name
    agentName
    traceTableMcon
    prodTargetPath
    devTargetPath
    evalConfig
    retentionDays
    testCaseCount
    lastUsedAt
    expiresAt
    createdTime
    updatedTime
  }
}

Related types

GoldenSet, UUID

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

ArgumentTypeDescription
agentNameStringScope to sets bound to this observability agent (with traceTableMcon).
traceTableMconStringMCON 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

GoldenSet

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

ArgumentTypeDescription
setUuidUUID!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

GoldenTestCase, UUID

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

ArgumentTypeDescription
setUuidUUID!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

GoldenTestRun, UUID

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

LinearIntegrationResult

Example

query GetLinearIntegration {
  getLinearIntegration {
    uuid
    webhookUrl
    webhookEnabled
    defaultTeamId
    integrationName
  }
}

Related types

LinearIntegrationResult

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

LinearTeam

Object type. A Linear team available via the account's configured integration.

FieldTypeDescription
idString!Linear team ID — pass as defaultTeamId or a ticket's teamId.
nameString!Team display name.
keyString!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.