Agent traces, part 1 of 7 (GraphQL)

Related queries and mutations in Agent traces and evaluations. Each has its own section.

Queries

evaluatePlatformAgentDataSource (query)

evaluatePlatformAgentDataSource 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

Evaluate a platform agent as a SQL data source for agent monitors

Arguments

ArgumentTypeDescription
agentMconString!MCON of the platform agent to evaluate
connectionIdUUIDConnection UUID (optional, defaults to the agent's schedule connection)
isAgentConversationAggregationBooleanWhen true, return the conversation-grain schema (turn_count, duration_seconds, active_duration_seconds, status, etc.) instead of the span-level schema. Required for conversation-scope monitors (eval and metric).
transforms[TransformInput!]Transforms to apply to the data source schema

Returns

PlatformAgentDataSourceEvaluationResult

Example

query EvaluatePlatformAgentDataSource($agentMcon: String!) {
  evaluatePlatformAgentDataSource(agentMcon: $agentMcon) {
    connectionUuid
    warehouseUuid
    mcons
    fullAgentSql
    rowCount
    unresolvedMcons
    whereCondition
  }
}

Types used only by evaluatePlatformAgentDataSource

PlatformAgentDataSourceEvaluationResult

Object type.

FieldTypeDescription
dataSourceDataSourceInterface!
connectionUuidUUID!
warehouseUuidUUID!
mcons[String!]!
errors[Error!]!
fullAgentSqlString!
rowCountInt
unresolvedMconsBoolean!
whereConditionString
segments[FilterValueInterface!]

Related types

DataSourceInterface, Error, FilterValueInterface, TransformInput, UUID

getAgentAlertInsight (query)

getAgentAlertInsight 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

Generate an AI insight about the dominant pattern in an agent alert's traces. Returns 1–3 observational sentences. Each call regenerates — insights are not persisted. Always returns a result: when no insight could be produced, insight is null and status says why. Branch on status rather than on insight.

Arguments

ArgumentTypeDescription
inputGetAgentAlertInsightInput!

Returns

AlertInsightResult

Example

query GetAgentAlertInsight($input: GetAgentAlertInsightInput!) {
  getAgentAlertInsight(input: $input) {
    alertId
    status
    insight
    entityIds
    entityType
    traceTableMcon
    agentName
    startTime
    endTime
  }
}

Types used only by getAgentAlertInsight

AlertInsightResult

Object type. Result of getAgentAlertInsight: an AI-authored insight about an alert's entities.

FieldTypeDescription
alertIdString!Alert UUID
statusAlertInsightStatus!Whether an insight was generated, and if not, why not. GENERATED: insight is set. BREACHING_ENTITIES_UNIDENTIFIED: the entities that breached could not be identified, so no sample could honestly be described as the breach. BREACHING_ENTITIES_NOT_IN_TRACE_STORE: the breaching entities are known but the trace store holds none of them for this window, so there are no spans to describe. NO_ENTITIES_FOUND: the breach population was identifiable but held no entities. ENTITY_FETCH_FAILED: reading the entities failed. AI_DISABLED: the account has AI models disabled. INSIGHT_GENERATION_FAILED: the model call failed. ALERT_NOT_FOUND: no such alert for this account. NOT_AN_AGENT_ALERT: the alert is not an agent alert. NO_ANOMALY_EVENT: the alert carries no anomaly event to describe. AGENT_UNRESOLVED: the monitor could not be resolved to an agent.
insightString1–3 observational sentences describing the dominant pattern in the alert's sampled entities. Quantified, naming tools/models/errors that recur. No causal verdicts — observational only. Null unless status is GENERATED; show a note derived from status instead of rendering this field empty.
entityIds[String!]!IDs of the sampled entities used to generate the insight, in the order they were presented to the LLM. The type of each ID is given by entity_type.
entityTypeString!The type of IDs in entity_ids: 'trace' or 'conversation', matching the grain the monitor aggregates over. Use this to construct the correct detail-page link.
traceTableMconStringMCON of the trace table backing this agent's monitor. Null when the monitor could not be resolved to an agent, or when the alert is not an agent alert — see status.
agentNameStringName of the agent. Null for platform agents where the name cannot be resolved from the monitor configuration.
startTimeDateTimeStart of the alert's evaluation window (inclusive). Null when no window could be derived — see status.
endTimeDateTimeEnd of the alert's evaluation window (inclusive). Null when no window could be derived — see status.
AlertInsightStatus

Enum type. Whether an agent alert insight was generated, and if not, why not.

Only GENERATED carries an insight. For every other value the insight is
null and the client should show a note explaining the absence.

ValueDescription
GENERATED
BREACHING_ENTITIES_UNIDENTIFIED
BREACHING_ENTITIES_NOT_IN_TRACE_STORE
NO_ENTITIES_FOUND
ENTITY_FETCH_FAILED
AI_DISABLED
INSIGHT_GENERATION_FAILED
ALERT_NOT_FOUND
NOT_AN_AGENT_ALERT
NO_ANOMALY_EVENT
AGENT_UNRESOLVED
GetAgentAlertInsightInput

Input object type. Input for getAgentAlertInsight query.

FieldTypeDescription
alertIdUUID!UUID of the alert to generate insight for

Related types

DateTime, UUID

getAgentAutoSetupAccountSetting (query)

getAgentAutoSetupAccountSetting 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 the account default for automatic coverage.

Returns

AgentAutoSetupAccountSetting

Example

query GetAgentAutoSetupAccountSetting {
  getAgentAutoSetupAccountSetting {
    enabled
    canEdit
    writesEnabled
  }
}

Related types

AgentAutoSetupAccountSetting

getAgentAutoSetupStates (query)

getAgentAutoSetupStates 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

Resolve automatic setup for agents and a registration selection.

Arguments

ArgumentTypeDescription
keys[AgentAutoSetupKey!]!Up to 1000 entries, including up to 500 valid keys. Malformed keys are ignored. Inaccessible agents are omitted.
candidateAgentAutoSetupCandidateOptional registration selection for the Add form.

Returns

AgentAutoSetupStates

Example

query GetAgentAutoSetupStates($keys: [AgentAutoSetupKey!]!) {
  getAgentAutoSetupStates(keys: $keys) {
    candidateCanEdit
  }
}

Types used only by getAgentAutoSetupStates

AgentAutoSetupCandidate

Input object type. A selection in the platform registration form.

FieldTypeDescription
warehouseUuidUUID!Warehouse UUID
agentNameString!Agent name on the platform
agentDatabaseString!Platform database containing the agent. For Databricks platform agents this is the Unity Catalog catalog name. For Agentforce this is the Salesforce organization ID.
agentSchemaString!Platform schema containing the agent. For Databricks platform agents this is the Unity Catalog schema name. For Agentforce this is the Data Cloud dataspace API name.
connectionUuidUUIDSource connection UUID. When omitted, keeps an existing agent's native schedule connection or saved export source. A new Genie agent reuses the collector connection at its location. Otherwise selects an allowed SQL connection on the warehouse. The chosen connection requires permission to use it.
domainUuidUUIDDomain to assign a Snowflake or Agentforce agent to (may be required for accounts using domain-based access); the caller needs monitor write access to it. Adding a domain preserves existing domain memberships. Not accepted for Databricks agents — their domains derive from the trace table's catalog domain assignments. An Agentforce registration shares this assignment with its imported ClickHouse agent.
platformAgentTypePlatformAgentTypePlatform agent integration type. Defaults to SNOWFLAKE when omitted, preserving backwards compatibility for Snowflake callers. Databricks Agent Bricks splits into two physical span shapes: DATABRICKS_MLFLOW_SDK (Mosaic AI Agent Framework + autolog) and DATABRICKS_MLFLOW_KA (Knowledge Assistant UI sync). The SDK and KA shapes differ on disk, so registration resolves the subtype from the trace table's physical shape — overriding the supplied value, and rejecting a fresh registration when the shape can't be resolved to exactly one of the two.
tablePrefixStringTrace-table identifier prefix. A blank value is treated as omitted. Databricks Genie defaults to its collector table. On Snowflake the prefix is optional and must match the saved value on re-registration. Databricks MLflow agents require a prefix. For DATABRICKS_MLFLOW_SDK it names the <table_prefix>_trace_unified view over <table_prefix>_otel_* tables. For DATABRICKS_MLFLOW_KA it is the Delta table name.
AgentAutoSetupKey

Input object type. Identify one agent by canonical MCON or by its storage MCON and exact span name.

FieldTypeDescription
agentMconStringCanonical agent MCON, including a native registration.
traceTableMconStringSpan storage MCON. Requires agentName.
agentNameStringExact span name. Requires traceTableMcon.
AgentAutoSetupStates

Object type.

FieldTypeDescription
states[AgentAutoSetupState!]!One state per accessible agent, in order of its first resolved key.
candidateCanEditBooleanFast estimate from the catalog. Add rechecks permission and the actual source. True when permitted, false when permission or scope denies access. Null for an absent, invalid, ambiguous or export-only selection, or when eligibility is unknown. Set automatic setup on the imported agent for export-only selections.

Related types

AgentAutoSetupState, PlatformAgentType, UUID

getAgentClassification (query)

getAgentClassification 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

Classify the agent-observability agent behind an anchor — sourceType, platformAgentType, traceBackend, plus identity (name/displayName/traceTableMcon). Anchor is a full mcon, or an (objectId, resourceUuid) pair resolved server-side. Returns null when the anchor resolves to no known asset. The same classification reported per-row on an incident's agent breakdown, without needing an incident.

Arguments

ArgumentTypeDescription
mconStringFull span-storage MCON that anchors the agent — a trace-table (table-kind) mcon or a platform-agent (aiagent-kind) mcon. Takes precedence over objectId/resourceUuid when both are supplied.
objectIdStringobjectId as produced by MCON-parsing utilities — the portion after the kind segment: a table's db:schema.table id or a Snowflake platform agent's db:schema.name reference — the two are shape-ambiguous, which is why resolution happens server-side. Requires resourceUuid.
resourceUuidUUIDWarehouse (resource) UUID that owns the objectId.
agentNameStringOptional agent name. Disambiguates multiplexed Genie spaces sharing one collector trace table, and doubles as a trace-table agent's span-derived name (which the mcon alone cannot supply).

Returns

AgentClassificationOutput

Example

query GetAgentClassification {
  getAgentClassification {
    sourceType
    traceBackend
    platformAgentType
    name
    displayName
    traceTableMcon
  }
}

Related types

AgentClassificationOutput, UUID

getAgentCost (query)

getAgentCost 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

Cost of an agent's model calls over a time range, in the agent's costUnit: credits, or the customer's currency when cost rates apply. With none of traceIds, conversationIds, bucketSize or spanBreakdown set, it also returns cacheSavings, traceCount, conversationCount, warehouseCost and warehouseCostAsOf for that window. A bucketSize with no traceIds or conversationIds returns the window whole: those same figures alongside the series, each bucket carrying its attributed warehouse cost beside the token cost, so the summary page's cards and chart load from a single call. Read separately from the trace and summary queries because it crosses to the customer's warehouse — the prompt-cache counts it needs exist nowhere else — so a client can render first and fill cost in after. It scans the agent's Snowflake event table, which only Cortex agents have, so it returns empty for any other agent. Two error shapes are expected traffic rather than failures: a request carrying an idempotency id whose scan is still running answers REQUEST_IN_PROGRESS, which the client re-sends under the same id until rows come back; and a request under an id whose earlier attempt failed answers a validation error carrying the IDEMPOTENT_REQUEST_FAILED code, on which the client must mint a fresh id for the same variables.

Arguments

ArgumentTypeDescription
agentNameString!Agent to price
traceTableMconString!MCON of the table holding the agent's traces
startTimeDateTime!Window start (inclusive)
endTimeDateTime!Window end (inclusive)
traceIds[String!]Scope to these traces and return one cost per trace. Omit for the window total.
conversationIds[String!]Scope to these conversations and return one cost per conversation. Cannot be combined with traceIds -- passing both is rejected.
bucketSizeTraceBucketSizeBucket the window at this size. Unscoped, the window total and its figures come back alongside the series; scoped to traceIds, only the series.
spanBreakdownBooleanReturn one cost per LLM call in the traces named by traceIds -- the spans carrying a model or a token count -- plus, when the attribution view is readable, one row per SqlExecution span, which carries no token cost but the warehouse compute cost, in costUnit, its queries were attributed. The response carries warehouseCostAsOf, the account-wide attribution cutoff, with the same meaning as the window grain's field. Each LLM row carries the model, the four token counts, and the four rates its price was computed from; cost is null when the price book has no rate for the model. The components sum to the span's total, and that total is the same value the other grains sum to -- an estimate that converges over a window, not a figure to reconcile one span against a bill. Requires traceIds (at most 100). Cannot be combined with bucketSize or conversationIds. Defaults to false: omit it (or send false) to get the grain the other arguments select.
includeQueryCostBooleanScoped to traceIds, each trace also carries queryCost (the warehouse compute cost attributed to its SQL queries) and totalCost (token cost plus queryCost). Attribution trails execution by about three hours, so a fresh trace's figures are lower bounds that keep filling in; a null queryCost means nothing has been attributed to the trace yet -- it ran no SQL, or attribution is still inside the lag. If the attribution view cannot be read at all, the read degrades: the token half still answers, each trace's queryCost and totalCost read null, and the response's warehouseCostAvailable is false. Costs the attribution scan, so it is opt-in. Requires traceIds; cannot be combined with spanBreakdown, bucketSize or conversationIds. Default: false.

Returns

AgentCost

Example

query GetAgentCost($agentName: String!, $traceTableMcon: String!, $startTime: DateTime!, $endTime: DateTime!) {
  getAgentCost(agentName: $agentName, traceTableMcon: $traceTableMcon, startTime: $startTime, endTime: $endTime) {
    cost
    costUnit
    cacheSavings
    traceCount
    conversationCount
    warehouseCost
    warehouseCostAsOf
    warehouseCostAvailable
  }
}

Types used only by getAgentCost

AgentCost

Object type.

FieldTypeDescription
costFloat
costUnitStringThe unit every cost in the response is in. That is credits, the platform's billing unit, unless the agent has customer rates for both its model calls and its SQL in one currency. Then it is that currency's lowercase ISO 4217 code, such as usd.
cacheSavingsFloatWhat the prompt cache saved over the window, in costUnit, compared with charging every input token at the regular input rate: the cache-read discount less the extra cost of cache writes above that rate. Negative when the extra cost of cache writes exceeds the read savings. None when the window was not read whole, or when nothing in it could be priced.
traceCountIntHow many traces the window total covers. Counts only traces with a priced span, so it is not the trace count the summary read reports. None when the read was scoped to traces or conversations.
conversationCountIntHow many conversations the window total covers. A Cortex thread id of '0' reads as no conversation and is not counted. None when the read was scoped to traces or conversations.
warehouseCostFloatThe warehouse compute cost Snowflake attributes to this agent's SQL queries over the window, in costUnit. A lower bound on the agent's share of the bill: warehouse idle time belongs to no query and is attributed to none. Zero when the window attributed nothing, which is what an agent served entirely from the result cache costs. None when the attribution view could not be read: the collector role may lack IMPORTED PRIVILEGES ON DATABASE SNOWFLAKE, or the read may run past its statement timeout on a wide window, which the warehouse answers by cancelling the query. Set when the window was read whole -- unscoped, with or without a bucket size.
warehouseCostAsOfDateTimeHow far warehouseCost has filled in: the latest query end the attribution view covers in the window. Account-wide rather than this agent's, so it reads as the view's coverage of the window. Attribution trails execution by about three hours, so a window that just ended is not done filling. A span breakdown sets it the same way, from the latest attribution cutoff its rows carry. None when the view could not be read, when nothing in the window was attributed account-wide, or -- on a breakdown -- when its traces recorded no query ids, leaving no row to carry the cutoff.
warehouseCostAvailableBooleanWhether the attribution read behind the spans' warehouseCost -- or, on a trace read that asked for the combined token + query cost, behind the traces' queryCost -- answered. False means a null says the read failed -- the grant missing, or the request's budget spent -- not that the span ran no SQL and not that the trace is still inside attribution's lag. Set on a span breakdown and on the combined trace read; true there, false when its attribution half failed and the token half degraded.
traces[TraceCost!]!
conversations[ConversationCost!]!
series[CostBucket!]!
spans[SpanCost!]!
ConversationCost

Object type.

FieldTypeDescription
conversationIdString!
costFloat
CostBucket

Object type.

FieldTypeDescription
bucketStartDateTime!
costFloat
warehouseCostFloatThe warehouse compute cost Snowflake attributes to this agent's SQL queries whose spans fall in the bucket, in costUnit. Zero when the bucket's queries attributed nothing. A query whose span carries no trace id -- or whose trace's spans all match the SqlExecution_CortexAnalyst exclusion -- counts in the response's warehouseCost but lands in no bucket, so the rows can sum below it. None for every bucket when the attribution view could not be read -- the agent-level warehouseCostAsOf is None then too.
CostComponent

Enum type. One of the four terms a Cortex span's price sums.

NEW_INPUT excludes cache reads and cache writes. Each token is charged
in one component at that component's rate.

ValueDescription
NEW_INPUT
OUTPUT
CACHE_READ
CACHE_WRITE
SpanCost

Object type.

FieldTypeDescription
spanIdString!The span's stored id.
traceIdString!The trace the span belongs to; one breakdown can mix traces.
startTimeDateTime!When the span started.
spanNameStringThe raw record name, including the per-iteration suffix (e.g. ReasoningAgentStepPlanning-0). The trace tree collapses the suffix; span_id matches the tree either way.
modelStringThe model the span was priced against.
costFloatThe span's price; None when the price book has no rate for the model.
components[SpanCostComponent!]!The four terms the price sums.
warehouseCostFloatThe warehouse compute cost Snowflake attributes to the SQL queries this span ran, in costUnit. One span per query carries the cost: the SqlExecution leaf that ran it, or the tool wrapper above it when no leaf span recorded the query. A SqlExecution span joins the breakdown with a null cost and no components; a span that also carried tokens keeps its cost alongside. Zero when the span's queries attributed nothing as of the attribution cutoff. None when the span ran no warehouse SQL, or when the attribution view could not be read -- then the SQL spans are absent and every listed span's warehouseCost is None.
SpanCostComponent

Object type.

FieldTypeDescription
componentCostComponent!Which of the four price terms this line is.
tokensIntThe token count this term charges.
rateFloatThe rate for this term, in costUnit per million tokens.
costFloatThis component's token count charged at its rate per million tokens. NEW_INPUT excludes cache reads and writes; each is charged in its own component. The components sum to the span's total.
TraceCost

Object type.

FieldTypeDescription
traceIdString!
costFloat
queryCostFloatThe warehouse compute cost Snowflake attributes to the trace's SQL queries, in costUnit. Set only when the read asked for the combined token + query cost (includeQueryCost); null otherwise. Null on that read means nothing has been attributed to the trace yet -- it ran no SQL, or attribution is still inside its lag -- never zero. A read whose attribution view cannot be read still returns the trace, with queryCost null and the response's warehouseCostAvailable false. Attribution trails execution by about three hours, so a fresh trace's figure is a lower bound that keeps filling in.
totalCostFloatcost plus queryCost, in the same unit. Set only when the read asked for the combined token + query cost (includeQueryCost). A component not yet known contributes zero, so a fresh trace's total is a lower bound until attribution catches up (~3h).

Related types

DateTime, TraceBucketSize

getAgentCostRates (query)

getAgentCostRates 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 agent cost rates: what one billing unit, such as a Snowflake credit, costs the customer. An agent's costs are shown in money when it has an AGENT rate and a COMPUTE rate in one currency. A warehouse rate wins over the account-wide rate. Requires the AI agent settings read permission.

Arguments

ArgumentTypeDescription
warehouseUuidUUIDOptional warehouse. With it, the list holds that warehouse's rates and the account-wide rates.

Returns

[AgentCostRate!]

Example

query GetAgentCostRates {
  getAgentCostRates {
    uuid
    warehouseUuid
    unit
    usageType
    amountPerUnit
    currency
    createdTime
    updatedTime
  }
}

Related types

AgentCostRate, UUID

getAgentCostTotals (query)

getAgentCostTotals 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

Window cost for several agents at once. Returns the total only: the cache savings and counts getAgentCost carries belong to a single agent's summary. The read scans Snowflake event tables for registered Cortex agents. A Cortex agent without native collection needs a valid saved source connection. Agents without an eligible Cortex registration are left out of the result rather than returned null. An eligible Cortex agent that priced nothing in the window comes back with a null cost, which is not zero. Two entries naming the same agent come back indistinguishable, so match results on the agent name and mcon they carry rather than by position. Three error shapes are expected traffic rather than failures: a request carrying an idempotency id whose scan is still running answers REQUEST_IN_PROGRESS, which the client re-sends under the same id until rows come back; a request that ran out of time before the scan started answers REQUEST_TIMEOUT, which the client re-sends under the same id; and a request under an id whose earlier attempt failed answers a validation error carrying the IDEMPOTENT_REQUEST_FAILED code, on which the client must mint a fresh id for the same variables.

Arguments

ArgumentTypeDescription
agents[AgentCostAgentInput!]!Agents to price, at most 25 per call
startTimeDateTime!Window start (inclusive)
endTimeDateTime!Window end (inclusive)

Returns

[AgentCostTotal!]

Example

query GetAgentCostTotals($agents: [AgentCostAgentInput!]!, $startTime: DateTime!, $endTime: DateTime!) {
  getAgentCostTotals(agents: $agents, startTime: $startTime, endTime: $endTime) {
    agentName
    traceTableMcon
    cost
    credits
    costUnit
  }
}

Types used only by getAgentCostTotals

AgentCostAgentInput

Input object type. One agent to price in a batched cost read.

FieldTypeDescription
agentNameString!Agent to price
traceTableMconString!MCON of the table holding the agent's traces
AgentCostTotal

Object type.

FieldTypeDescription
agentNameString!
traceTableMconString!
costFloatThe window total in costUnit. Null when the window held no priced model call, which is not zero.
creditsFloatThe window total in the platform's billing unit, such as Snowflake credits, whatever costUnit is. Sort agents on this: agents priced at different rates or in different currencies compare on it.
costUnitStringThe unit cost is in. That is credits, the platform's billing unit, unless the agent has customer rates for both its model calls and its SQL in one currency. Then it is that currency's lowercase ISO 4217 code, such as usd.

Related types

DateTime

getAgentDetails (query)

getAgentDetails 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 summary stats for a single agent (last trace, total traces over the trailing 7 days, plus active-alerts count). Returns null when the MCON is malformed/unsupported or the agent name is empty.

Arguments

ArgumentTypeDescription
mconString!Trace-table MCON or platform-agent MCON that scopes the lookup. Both flavors are accepted.
agentNameString!Name of the agent within the trace table / platform agent.
createdTimeDateTimeRangeInputOptional time window for the active-alerts lookback. Filters activeAlertsCount by the time at which each alert's underlying event was recorded — after is inclusive, before is exclusive. Defaults to the trailing 7 days (after = now - 7 days, before = now) when omitted. The window must be at most 65 days. Only activeAlertsCount is bounded by this argument; lastTraceTime and totalTraces are computed over a fixed trailing 7-day window and are not configurable.

Returns

AgentDetails

Example

query GetAgentDetails($mcon: String!, $agentName: String!) {
  getAgentDetails(mcon: $mcon, agentName: $agentName) {
    agentName
    mcon
    lastTraceTime
    totalTraces
    activeAlertsCount
    splitBy
  }
}

Types used only by getAgentDetails

AgentDetails

Object type. Summary stats for a single agent.

FieldTypeDescription
agentNameString!Echo of the agent name the lookup was scoped to.
mconString!Echo of the trace-table or platform-agent MCON the lookup was scoped to.
lastTraceTimeDateTimeTimestamp of the most recent trace recorded for this agent in the lookup window. Null when the agent has no traces in the window.
totalTracesInt!Count of distinct traces recorded for this agent in the lookup window.
activeAlertsCountInt!Number of active (non-resolved, non-merged) incidents from agent monitors targeting this agent.
splitByObservedAgentSplitByHow the agent splits into workflow agents. Null: not split.

Related types

DateTime, DateTimeRangeInput, ObservedAgentSplitBy

getAgentDomainCandidates (query)

getAgentDomainCandidates 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

Agents the caller may assign to a domain individually, ordered by name. Reaches every live agent, including quiet ones the agents listing leaves out.

Arguments

ArgumentTypeDescription
searchStringPart of the agent name, ignoring case
limitIntPage size, at most 100 Default: 50.
offsetIntCandidates to skip Default: 0.

Returns

AgentDomainCandidatePage!

Example

query GetAgentDomainCandidates {
  getAgentDomainCandidates {
    hasMore
  }
}

Types used only by getAgentDomainCandidates

AgentDomainCandidatePage

Object type.

FieldTypeDescription
candidates[AgentDomainCandidate!]!
hasMoreBoolean!Whether a later page holds more candidates

Related types

AgentDomainCandidate

getAgentDomainCandidatesByMcon (query)

getAgentDomainCandidatesByMcon 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 agents among agentMcons the caller may assign to a domain, for showing a saved selection. Unknown agents and agents out of scope are left out.

Arguments

ArgumentTypeDescription
agentMcons[String!]!

Returns

[AgentDomainCandidate!]!

Example

query GetAgentDomainCandidatesByMcon($agentMcons: [String!]!) {
  getAgentDomainCandidatesByMcon(agentMcons: $agentMcons) {
    agentMcon
    agentName
    displayName
    storageMcon
    sourceType
    lastSeenAt
  }
}

Related types

AgentDomainCandidate

getAgentFeedback (query)

getAgentFeedback 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

End-user feedback on a page of an agent's traces. Cortex and Genie feedback is collected from the warehouse. Code-based agents send feedback spans to Agent Observability ClickHouse. On a ClickHouse trace store, AGENT_FEEDBACK_UNAVAILABLE means the check for the agent's feedback got no answer or ran out of time, the store does not hold the newest feedback yet, or feedback collection is turned off for the account. REQUEST_TIMEOUT means the feedback read ran out of time. Other query failures are returned unchanged.

Arguments

ArgumentTypeDescription
agentNameString!Agent the traces belong to
traceTableMconString!MCON of the table holding the agent's traces
traceIds[String!]!Hex trace ids, at most 100. Returned lowercase.

Returns

AgentFeedback

Example

query GetAgentFeedback($agentName: String!, $traceTableMcon: String!, $traceIds: [String!]!) {
  getAgentFeedback(agentName: $agentName, traceTableMcon: $traceTableMcon, traceIds: $traceIds) {
    feedbackAvailable
    contentWithheldReason
  }
}

Types used only by getAgentFeedback

AgentFeedback

Object type.

FieldTypeDescription
feedbackAvailableBoolean!False when this agent's feedback is not collected for this trace store. Snowflake Cortex agents have it, and Genie agents once their collector is upgraded.
traces[TraceFeedback!]!The newest feedback per trace. Traces with no feedback are absent.
contentWithheldReasonRawContentWithheldReasonSet when some categories were withheld. Those traces' categories are empty.
TraceFeedback

Object type.

FieldTypeDescription
traceIdString!Hex trace id, lowercase.
positiveBooleanTrue for thumbs up, false for thumbs down, null if unrated.
hasCommentBoolean!Whether the feedback carries a comment. The text is not returned here.
submittedAtDateTime!When the end user gave the feedback. For Genie, the message's last update as of the run that saw the change, or that run's time when Genie gave none.
categories[String!]!What the end user said was wrong, as the vendor names it, such as WRONG_CALCULATIONS. Cortex categories can be labels the customer defines. Empty when none were picked, when withheld, or when they were not collected.

Related types

DateTime, RawContentWithheldReason

getAgentFeedbackComments (query)

getAgentFeedbackComments 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 comment and user on each trace's newest end-user feedback. Traces whose comments are withheld are left out, and contentWithheldReason says why: the user may not read raw content, or the read fails.

Arguments

ArgumentTypeDescription
agentNameString!Agent the traces belong to
traceTableMconString!MCON of the table holding the agent's traces
traceIds[String!]!Traces to read comments for, at most 25

Returns

AgentFeedbackComments

Example

query GetAgentFeedbackComments($agentName: String!, $traceTableMcon: String!, $traceIds: [String!]!) {
  getAgentFeedbackComments(agentName: $agentName, traceTableMcon: $traceTableMcon, traceIds: $traceIds) {
    contentWithheldReason
  }
}

Types used only by getAgentFeedbackComments

AgentFeedbackComments

Object type.

FieldTypeDescription
traces[TraceFeedbackComment!]!One entry per trace with feedback, except traces whose comments are withheld.
contentWithheldReasonRawContentWithheldReason
TraceFeedbackComment

Object type.

FieldTypeDescription
traceIdString!
commentStringNull when the feedback has no comment, or the warehouse no longer returns the feedback event.
userNameStringThe user who gave the feedback, as the vendor reports it. Null when the vendor reports no user, or the warehouse no longer returns the feedback event.
submittedAtDateTime!

Related types

DateTime, RawContentWithheldReason

getAgentFeedbackStatus (query)

getAgentFeedbackStatus 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

Whether code-agent feedback is available and whether stored feedback has unmatched targets older than 24 hours. An incomplete check reports checkComplete false.

Arguments

ArgumentTypeDescription
agentNameString!
traceTableMconString!

Returns

AgentFeedbackStatus

Example

query GetAgentFeedbackStatus($agentName: String!, $traceTableMcon: String!) {
  getAgentFeedbackStatus(agentName: $agentName, traceTableMcon: $traceTableMcon) {
    supported
    hasFeedback
    unmatchedFeedbackCount
    checkComplete
  }
}

Types used only by getAgentFeedbackStatus

AgentFeedbackStatus

Object type.

FieldTypeDescription
supportedBoolean!Whether code feedback is supported for this agent and store. False also applies while support cannot be checked.
hasFeedbackBoolean!Whether this agent has stored code feedback, including retractions.
unmatchedFeedbackCountIntFeedback targets older than 24 hours with no retained normal trace. Null means the count is unavailable or unsupported; zero means a completed check found none.
checkCompleteBoolean!Whether the status is known. A supported agent's unmatched count is available only after a complete, recent check.

getAgentGraph (query)

getAgentGraph 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

Read the daily-refreshed snapshot of an agent's fused trace graph. Nodes group spans by (kind, name) — and additionally by model for LLM spans — and edges record sibling-sequence transitions within each trace. Returns per-node counts, error rates, duration/token statistics, and per-trace iteration stats so cycles are visible. Snapshots cover the trailing 7 days, fuse up to 1000 traces, and are refreshed daily; an agent or workflow without a computed snapshot yet returns an 'Agent graph snapshot not found' error. Set liveGraph true to skip the snapshot and fuse the graph on the fly from the window/filter args (startTime/endTime required, capped at 100 most-recent traces).

Arguments

ArgumentTypeDescription
inputGetAgentGraphInput!

Returns

AgentGraph

Example

query GetAgentGraph($input: GetAgentGraphInput!) {
  getAgentGraph(input: $input) {
    traceCount
    spanCount
    windowStart
    windowEnd
  }
}

Types used only by getAgentGraph

AgentGraph

Object type. A directed graph fused from multiple traces of the same workflow.

FieldTypeDescription
nodes[AgentGraphNode!]!
edges[AgentGraphEdge!]!
traceCountInt!Actual number of traces fused (≤ max_traces, ≤ 100).
spanCountInt!Total number of spans across all fused traces. When a workflow filter is applied, counts only the spans attributed to the requested workflows.
windowStartDateTime!Earliest start time across the fused traces — the lower bound of where the data actually lives. Computed as min(trace_start_time) across the listed traces. Falls back to the request startTime when no traces are fused. Use this (not the request window) for the lower bound of timeline visualizations.
windowEndDateTime!Latest end time across the fused traces — the upper bound of where the data actually lives. Computed as max(trace_end_time) across the listed traces. Falls back to the request endTime when no traces are fused.
AgentGraphEdge

Object type. A directed edge representing sibling-sequence flow.

Source and target are siblings under the same parent in the same
trace, with target's time-overlap cluster following source's.
Containment is NOT expressed as an edge — walk
AgentGraphNode.parentId instead.

Sequential edges have sourceClusterSize and targetClusterSize
both equal to 1. When either is greater than 1 the edge is part of a
parallel fan-in/fan-out — see the per-field docs for how to interpret.

FieldTypeDescription
sourceIdString!Source node id.
targetIdString!Target node id.
countInt!Number of times the source span was followed by the target.
probabilityFloat!Share of source occurrences that transition to target (count / source.count). For sequential edges this is in [0, 1] and per-source probabilities sum to <=1. For parallel fan-outs each branch fires every time the source fires, so per-branch probabilities are 1.0 and the per-source sum equals the number of parallel branches. Use sourceClusterSize/targetClusterSize to detect parallel structure and renormalize visually as needed.
p50GapMsFloatMedian (50th percentile) gap in milliseconds between the source span's end and the target span's start. Clamped at 0 to absorb clock skew.
sourceClusterSizeInt!Number of parallel siblings on the SOURCE side at this transition (including the source itself). When >1, this edge is part of a fan-IN: that many spans ran in parallel and all transition into the target. Defaults to 1 for plain sequential edges. The largest cluster size observed across all fused traces is reported.
targetClusterSizeInt!Number of parallel siblings on the TARGET side at this transition (including the target itself). When >1, this edge is part of a fan-OUT: the source diverges into that many parallel branches. Defaults to 1 for plain sequential edges. The largest cluster size observed across all fused traces is reported.
AgentGraphErrorSpan

Object type. Pointer to a single span occurrence that contributed to a node's error count.

FieldTypeDescription
traceIdString!trace_id of the error span.
spanIdString!span_id of the error span. Always a member of traceId.
AgentGraphNode

Object type. A node in the fused agent graph — one logical step across traces.

FieldTypeDescription
idString!Stable identifier within this graph. Treat as opaque — use parentId to navigate the workflow hierarchy.
parentIdStringid of the parent node in the fused graph. When includeFrameworkNodes is false (the default), framework wrapper spans are dropped server-side and their children re-parent to the nearest non-wrapper ancestor — so parentId points at the nearest user-code node. When includeFrameworkNodes is true, parentId is the immediate parent span's node. The one other skip applies in both modes: a synthesized Databricks Genie narration span (genie_context, genie_reasoning, genie_research_step) carries a step's text rather than trace structure, so its children re-parent to the Genie turn — the same parent they report when the agent emits no such spans. Null for root nodes, when every ancestor is narration, or when the resolved parent span did not make it into the graph (e.g. malformed). Walk these to build the hierarchy as a tree — containment is NOT expressed as edges.
kindAgentGraphNodeKind!Span kind. LLM and TOOL are derived from the ingest-layer flags on the span; WORKFLOW / TASK / AGENT / CHAIN come from the Traceloop / OpenLLMetry kind suffix on the span name. Spans those signals leave unclassified fall back to conventions: a populated model → LLM, a span named after its declared task / workflow attribute → TASK / WORKFLOW, trace roots → WORKFLOW, agent.task. / agent.tool. name prefixes, then conservative name-keyword matching. UNKNOWN is the catch-all for spans with no safe signal.
nameString!Span name (typically the function or step).
modelStringModel name. Set only when kind='llm'; null otherwise.
frameworkNodeBoolean!True when this node represents a framework-plumbing wrapper (e.g. a LangChain Runnable or output parser, a LangGraph channel) rather than user code. Always false when includeFrameworkNodes is false (the default), because wrappers are stripped server-side in that mode. When includeFrameworkNodes is true, wrappers appear as their own nodes with this flag set, and id / parentId reflect the raw tree (bar the Genie narration skip described on parentId) — UIs can use this flag to de-emphasize plumbing without hiding it.
countInt!Total span occurrences across all fused traces.
traceCountInt!Number of distinct traces that contain this node.
errorCountInt!Number of span occurrences with an error status.
errorSpans[AgentGraphErrorSpan!]!(traceId, spanId) for every span occurrence of this node that had an error status. Empty when errorCount=0.
p50DurationMsFloatMedian (50th percentile) duration in milliseconds over measured spans (null when no span is measured).
p95DurationMsFloat95th percentile duration in milliseconds over measured spans (null when no span is measured).
p50InputTokensFloatMedian (50th percentile) prompt tokens. Null for non-LLM nodes.
p50OutputTokensFloatMedian (50th percentile) completion tokens. Null for non-LLM nodes.
p50OutputBytesFloatMedian (50th percentile) size of the tool result, in UTF-8 code points (i.e. character count, not raw octets). Rolled up across every occurrence of this node. Set only for TOOL nodes whose spans record an output; null for other node kinds, and null when the underlying trace store does not expose per-tool output size.
p95OutputBytesFloat95th percentile size of the tool result, in UTF-8 code points. See p50OutputBytes for units and nullability.
p50IterationsPerTraceFloat!Median (50th percentile) occurrences of this node within a single trace. Values >1 indicate the node is invoked multiple times in a trace (a cycle).
maxIterationsPerTraceInt!Maximum occurrences observed in a single trace.
p95IterationsPerTraceFloat!95th percentile of per-trace occurrence count.
p50StartMsFloatMedian (50th percentile) start time of this node within its trace, in milliseconds. Measured from the earliest span in the trace, so all traces normalize to a common origin of 0. Combined with p50DurationMs / p50EndMs, lets a UI place the node on a Gantt-style timeline of a typical trace. Null when no contributing span had a usable start_time.
p50EndMsFloatMedian (50th percentile) end time of this node within its trace, in milliseconds. See p50StartMs.
exampleSpanIdString!span_id of one example span that contributed to this node (the first one seen during fusion). Look up the row in the spans table to inspect raw attributes, or pull the surrounding trace via exampleTraceId. Useful when investigating unexpected nodes (e.g. orphans with parentId == null).
exampleTraceIdString!trace_id of the trace containing exampleSpanId. exampleSpanId is guaranteed to be a member of this trace (both fields are captured atomically from the same span).
AgentGraphNodeKind

Enum type. Kind of a fused agent-graph node — derived from the underlying span.

is_llm_call=True → LLM; is_tool_call=True → TOOL; otherwise the
Traceloop / OpenLLMetry suffix on the span name (.workflow,
.task, .agent, .chain) becomes the kind. Spans those signals
leave unclassified fall back to a convention ladder (strongest
evidence first): a populated model → LLM; a span named after its
declared task / workflow attribute → TASK / WORKFLOW; a trace root →
WORKFLOW; agent.task. / agent.tool. name prefixes; then
conservative name-keyword matching. Anything left over is UNKNOWN.

ValueDescription
LLM
TOOL
WORKFLOW
TASK
AGENT
CHAIN
UNKNOWN
GetAgentGraphInput

Input object type. Input parameters for GetAgentGraph.

getAgentGraph reads a daily-refreshed snapshot of the fused graph for
the trailing 7 days and ignores startTime, endTime, maxTraces,
and includeFrameworkNodes — the snapshot window and shape are fixed
server-side (framework wrappers collapsed, up to 1000 traces). Set
liveGraph true to bypass the snapshot and fuse traces on the fly; in
that mode all of those fields are honored and startTime / endTime
are required (enforced at the resolver — the shared schema type can no
longer mark them non-null).

FieldTypeDescription
agentNameString!Agent name — same value passed as agentName on getTraces.
traceTableMconString!MCON of the trace table or platform agent (aiagent object type) to query.
liveGraphBooleanWhen true, bypass the stored daily snapshot and fuse the graph on the fly from the other window/filter args (startTime, endTime, workflows, maxTraces, includeFrameworkNodes). Live fusion is capped at 100 most-recent traces and requires startTime / endTime. When false (the default) those fields are ignored and the fixed-window snapshot is returned. Default: false.
startTimeDateTimeStart of time range (inclusive). Required when liveGraph is true. Ignored otherwise — the snapshot window is fixed at the trailing 7 days.
endTimeDateTimeEnd of time range (inclusive). Required when liveGraph is true. Ignored otherwise.
workflows[String]Optional list of workflow names to scope the graph to. A null element selects the no-workflow scope — spans carrying no workflow label. The graph is built from the agent's most recent traces containing any listed workflow (OR logic, same trace selection as filters.workflows on getTraces), but node and edge statistics count only spans labeled with one of the listed workflows — spans belonging to other workflows in those traces are excluded, and ancestor steps carrying a different label are retained as zero-stat structural nodes so the hierarchy stays connected. The snapshot read uses the matching per-workflow snapshot and supports at most one entry today — supplying more raises a validation error; omit or pass an empty list for the unfiltered graph.
maxTracesIntMaximum number of most-recent traces to fuse into the graph. Capped at 100; values above 100 are clamped server-side. Only honored when liveGraph is true — the snapshot always fuses up to 1000 traces. Default: 100.
includeFrameworkNodesBooleanWhen false (the default), framework-plumbing wrapper nodes (e.g. LangChain Runnables, LangGraph channels) are filtered out and their children re-parent to the nearest user-code ancestor — the graph behaves as if the wrappers were never emitted. When true, wrappers appear as their own nodes flagged via frameworkNode, and counts / edges / cluster sizes reflect the full uncollapsed tree. Only honored when liveGraph is true — the snapshot stores the collapsed graph only. Default: false.

Related types

DateTime

getAgentMetadata (query)

getAgentMetadata 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 AI agents for agent observability

Arguments

ArgumentTypeDescription
startTimeDateTimeFilter spans with start_time >= this value
domainUuidUUIDFilter results to only include MCONs assigned to this domain UUID

Returns

[AgentMetadata]

Example

query GetAgentMetadata {
  getAgentMetadata {
    accountUuid
    agentName
    traceTableMcon
  }
}

Types used only by getAgentMetadata

AgentMetadata

Object type. Metadata about AI agents for agent observability.

FieldTypeDescription
accountUuidUUID!Account UUID
agentNameString!Name of the agent
traceTableMconString!MCON of the trace table associated with this agent

Related types

DateTime, UUID

Source: The GraphQL API reference

This page is generated from the GraphQL schema on each release. Changes made in ReadMe are overwritten.