Agent traces, part 4 of 7 (GraphQL)

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

Queries

getLlmPriceBook (query)

getLlmPriceBook 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 LLM price book agent costs are computed against: every model with its four per-million-token rates, the unit each rate table is denominated in, and the vendor pages the rates were read from. The book ships with the product and is the same for every account, so this takes no arguments; an account's negotiated rates are layered on top as overrides (see getLlmPriceBookOverrides), so an account holding one is priced from rates this read does not show. A model absent both from a table here and from the account's overrides has no rate and prices to null, never to zero.

Returns

PriceBook

Example

query GetLlmPriceBook {
  getLlmPriceBook {
    version
    lastVerified
    editable
  }
}

Types used only by getLlmPriceBook

AgentCostType

Enum type. How an agent's model execution is billed, decided by who runs the model.

Only billing we hold rates for is named here. An agent billed some other way has no
member, is priced by nothing, and renders no cost.

ValueDescription
SNOWFLAKE_CORTEX
PriceBook

Object type.

FieldTypeDescription
versionInt!Bumped whenever a rate changes.
lastVerifiedDate!When the rates were last checked against the vendor pages. Rates are flat rather than effective-dated, so a change re-prices every span still in retention.
editableBoolean!Whether an account can change the rates it is priced against. True: not by editing this shipped book, which is the same for every account, but through per-account overrides (getLlmPriceBookOverrides / upsertLlmPriceBookOverride).
computations[PriceBookComputation!]!The rate tables, ordered by identifier.
PriceBookComputation

Object type.

FieldTypeDescription
computationComputationId!Identifier of the pricing method this table implements.
unitRateUnit!What every rate in this table is denominated in. This is the rate unit, not the cost unit: rates here are per million tokens, and a cost computed from them is reported by getAgentCost.costUnit. That is credits, or the customer's currency when cost rates apply.
agentCostTypes[AgentCostType!]!The kinds of agent priced by this table. An agent billed some other way is named by no cost type, is priced by no table, and renders no cost.
sources[PriceBookSource!]!The vendor pages the rates were read from.
models[PriceBookModelRate!]!Rates by model, grouped by model family with the newest version of each family first. A model absent here has no rate and prices to null -- never to zero.
PriceBookModelRate

Object type.

FieldTypeDescription
modelString!Canonical model name. A raw model value is reduced to this first: region, vendor and Databricks endpoint prefixes are stripped, then version and datestamp suffixes, then known aliases are applied. So one row here prices every spelling that reduces to it.
inputRateFloat!Fresh input, excluding anything served from or written to cache.
outputRateFloat!Generated tokens.
cacheReadRateFloat!Input served from the prompt cache.
cacheWriteRateFloat!Input written into the prompt cache. Equal to the input rate where the provider does not charge a premium for the write.
PriceBookSource

Object type.

FieldTypeDescription
vendorString!The model vendor these rates are for. Not necessarily who publishes the page -- a vendor without a public rate card is cited from a reseller's.
urlString!The pricing page the rates were read from.
RateUnit

Enum type. What a rate is denominated in. Costs in different units cannot be summed.

ValueDescription
USD_PER_MILLION_TOKENS
CREDITS_PER_MILLION_TOKENS
DBU_PER_MILLION_TOKENS

Related types

ComputationId, Date

getLlmPriceBookOverrides (query)

getLlmPriceBookOverrides 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 LLM price book overrides: the negotiated per-model rates that replace the shipped book's rates when agent costs are computed. An override names a (computation, model) pair and carries all four per-million-token rates. Every override applies account-wide, to all the account's connections. A pair with no override keeps the shipped rate. Requires the AI agent settings read permission.

Arguments

ArgumentTypeDescription
warehouseUuidUUIDOptional warehouse connection the caller must have access to. Every override applies to all connections, so the list is the same with or without it.

Returns

[LlmPriceBookOverride!]

Example

query GetLlmPriceBookOverrides {
  getLlmPriceBookOverrides {
    uuid
    warehouseUuid
    computation
    model
    inputRate
    outputRate
    cacheReadRate
    cacheWriteRate
    createdTime
    updatedTime
  }
}

Related types

LlmPriceBookOverride, UUID

getNodeAttributes (query)

getNodeAttributes 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 raw OTel attributes and error info for a single node from the warehouse. All node types (agent, workflow, task, tool, LLM) return error_message and span_metadata. LLM nodes additionally return prompts and completions when is_llm_call=True. Fired independently after getSpanDetail resolves (when has_error=True) and when the user opens the Metadata or Content tab.

Arguments

ArgumentTypeDescription
inputGetNodeAttributesInput!

Returns

NodeAttributes

Example

query GetNodeAttributes($input: GetNodeAttributesInput!) {
  getNodeAttributes(input: $input) {
    errorMessage
    spanMetadata
    prompts
    completions
  }
}

Types used only by getNodeAttributes

GetNodeAttributesInput

Input object type. Input for the getNodeAttributes query.

FieldTypeDescription
traceTableMconString!MCON of the trace table to query
spanIdString!OTel span ID (hex string)
isLlmCallBoolean!True for LLM nodes — fetches prompts and completions in addition to metadata
fromTimestampDateTime!Start of the time window
toTimestampDateTime!End of the time window
agentNameStringIdentifies the specific agent when several share one trace table (e.g. multiple Databricks AI/BI Genie spaces collected into one table). Pass the agent's name so the node's attributes resolve to the correct one; omit it for single-agent tables.
NodeAttributes

Object type. OTel attributes and error info for a single node fetched from the warehouse.

FieldTypeDescription
errorMessageStringHuman-readable error message derived from exception events or span status
spanMetadataStringFull OTel span attributes as a JSON string (key-value map)
promptsStringLLM prompts as a JSON string — present when is_llm_call=True
completionsStringLLM completions as a JSON string — present when is_llm_call=True

Related types

DateTime

getNodeDetail (query)

getNodeDetail 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 detail for a single trace tree node including all span fields and trend metrics. Returns a typed node (AgentNodeDetail, WorkflowNodeDetail, TaskNodeDetail, ToolNodeDetail, or LlmNodeDetail) based on span classification. Trend metrics are computed over spans with the same (workflow, task, name) within the active filter period. TimescaleDB-only — no warehouse calls.

Arguments

ArgumentTypeDescription
inputGetNodeDetailInput!

Returns

NodeDetail

Example

query GetNodeDetail($input: GetNodeDetailInput!) {
  getNodeDetail(input: $input) {
    spanId
    traceId
    nodeName
    parentSpanId
    duration
    startTime
    endTime
    ingestTime
    hasPrompts
    hasCompletions
    hasError
    agentName
    workflow
    task
    childSpanIds
    isToolCall
    isLlmCall
    status
    model
    promptTokens
  }
}

Types used only by getNodeDetail

GetNodeDetailInput

Input object type. Input for getNodeDetail query.

FieldTypeDescription
traceTableMconString!MCON of the trace table
traceIdString!Trace ID (hex-encoded)
spanIdString!Span ID (hex-encoded)
fromTimestampDateTime!Start of the active filter period (inclusive)
toTimestampDateTime!End of the active filter period (inclusive)
agentNameStringAgent the span belongs to. Lets a user who can access that agent, but not its whole trace table, read the span.
NodeDetail

Object type. Detail for a single trace tree node returned by getNodeDetail.

FieldTypeDescription
spanIdString!Span ID (hex-encoded)
traceIdString!Trace ID (hex-encoded)
nodeNameString!Span name
parentSpanIdStringParent span ID (hex-encoded); null for root
durationFloat!Span duration in milliseconds
startTimeDateTimeSpan start time
endTimeDateTimeSpan end time
ingestTimeDateTimeSpan ingest time
hasPromptsBoolean!Whether span has prompt data
hasCompletionsBoolean!Whether span has completion data
hasErrorBoolean!True if span has OTel error status (status == 2)
agentNameStringAgent name
workflowStringWorkflow name
taskStringTask name
childSpanIds[String!]!IDs of direct child spans
isToolCallBooleanWhether span represents a tool call
isLlmCallBooleanWhether span represents an LLM call
statusIntOTel status code (0=unset, 1=ok, 2=error); null when the span carries no status
modelStringLLM model used; non-null when is_llm_call=true
promptTokensIntPrompt tokens; non-null when is_llm_call=true
completionTokensIntCompletion tokens; non-null when is_llm_call=true
totalTokensIntTotal tokens; non-null when is_llm_call=true
trendSpanTrendMetricsTrend metrics for spans with the same (workflow, task, name) over the filter period
SpanTrendMetrics

Object type. Trend metrics for a span type, aggregated over the active filter period.

FieldTypeDescription
avgDurationFloatAverage span duration in milliseconds over the filter period
avgTotalTokensFloatAverage total token count over the filter period
avgPromptTokensFloatAverage prompt token count over the filter period
avgCompletionTokensFloatAverage completion token count over the filter period

Related types

DateTime

getObservedAgentSettings (query)

getObservedAgentSettings 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

An observed agent's settings, such as its split by workflow. Reads no traces. Null when the agent has no settings to change: it was never observed, or it is not on a ClickHouse trace table, so updateObservedAgentSettings refuses it.

Arguments

ArgumentTypeDescription
traceTableMconString!MCON of the agent's trace table, as on getAgentMetadataV2.
agentNameString!The agent's name.

Returns

ObservedAgentSettings

Example

query GetObservedAgentSettings($traceTableMcon: String!, $agentName: String!) {
  getObservedAgentSettings(traceTableMcon: $traceTableMcon, agentName: $agentName) {
    traceTableMcon
    agentName
    splitBy
  }
}

Related types

ObservedAgentSettings

getPlatformAgentRegistrationDomains (query)

getPlatformAgentRegistrationDomains 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 names and IDs of metadata domains available for platform-agent registration. Requires monitor write permission and includes only domains covered by that permission. Returns an empty list when none are available.

Returns

[PlatformAgentRegistrationDomain!]!

Example

query GetPlatformAgentRegistrationDomains {
  getPlatformAgentRegistrationDomains {
    id
    name
  }
}

Types used only by getPlatformAgentRegistrationDomains

PlatformAgentRegistrationDomain

Object type. A domain available for platform-agent registration.

FieldTypeDescription
idUUID!Domain UUID
nameString!Domain name

Related types

UUID

getPlatformAgents (query)

getPlatformAgents 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 platform agents for the authenticated user's account

Arguments

ArgumentTypeDescription
domainUuidUUIDFilter results to agents assigned to this domain

Returns

[PlatformAgent!]!

Example

query GetPlatformAgents {
  getPlatformAgents {
    id
    createdTime
    updatedTime
    uuid
    agentType
    agentMcon
    agentName
    agentDatabase
    agentSchema
    tablePrefix
    recommendationsGeneratedAt
    displayName
    supportsConversationEval
    supportsConversationClustering
    supportsTokenMetrics
    supportsEndUserFeedback
    traceTableMcon
    traceTableIngested
  }
}

Related types

PlatformAgent, UUID

getReinforcementLoopAgent (query)

getReinforcementLoopAgent 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 reinforcement loop's state for one agent: whether the user paused it, and whether the loop can't diagnose it and why. An agent with no saved settings reports the defaults.

Arguments

ArgumentTypeDescription
agentNameString!Observability agent name.
traceTableMconString!MCON of the agent's trace table — same value passed as traceTableMcon on getAgentGraph.

Returns

ReinforcementLoopAgent!

Example

query GetReinforcementLoopAgent($agentName: String!, $traceTableMcon: String!) {
  getReinforcementLoopAgent(agentName: $agentName, traceTableMcon: $traceTableMcon) {
    agentName
    traceTableMcon
    isPaused
    isRunning
    lastCheckedAt
    requiresCodeRepo
  }
}

Related types

ReinforcementLoopAgent

getReinforcementLoopCodeProjects (query)

getReinforcementLoopCodeProjects 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 projects of an Azure DevOps integration's organization, sorted. The values project on updateReinforcementLoopAgent's codeRepos accepts. Fails with VALIDATION_ERROR when Azure DevOps refuses the read, REQUEST_TIMEOUT when it doesn't answer in time, and RATE_LIMIT_EXCEEDED when it is limiting requests.

Arguments

ArgumentTypeDescription
installationUuidUUID!One of the account's Azure DevOps integrations.

Returns

[String!]!

Example

query GetReinforcementLoopCodeProjects($installationUuid: UUID!) {
  getReinforcementLoopCodeProjects(installationUuid: $installationUuid)
}

Related types

UUID

getReinforcementLoopCodeRepos (query)

getReinforcementLoopCodeRepos 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 repos an installation can read, sorted by name. The values repo on updateReinforcementLoopAgent's codeRepos accepts. Fails with VALIDATION_ERROR when the host refuses the read, REQUEST_TIMEOUT when Azure DevOps doesn't answer in time, and RATE_LIMIT_EXCEEDED when it is limiting requests.

Arguments

ArgumentTypeDescription
installationUuidUUID!One of the account's GitHub App installations or Azure DevOps integrations.
projectStringThe Azure DevOps project. Required for Azure DevOps; omit for GitHub.

Returns

[ReinforcementLoopCodeRepoOption!]!

Example

query GetReinforcementLoopCodeRepos($installationUuid: UUID!) {
  getReinforcementLoopCodeRepos(installationUuid: $installationUuid) {
    name
    defaultBranch
  }
}

Types used only by getReinforcementLoopCodeRepos

ReinforcementLoopCodeRepoOption

Object type. A repo an installation can read.

FieldTypeDescription
nameString!The value repo takes on save.
defaultBranchStringThe repo's default branch; null for a GitHub repo or an empty repo.

Related types

UUID

getReinforcementLoopDiagnosisTriggers (query)

getReinforcementLoopDiagnosisTriggers 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

Monte Carlo users only. The reinforcement loop's diagnosis input for an agent's conversations labeled in a window, one payload per Issue space, the agent-wide one first. Every current Issue cluster counts, whatever the selector chose. A conversation appears once, with every cluster it matched. For Snowflake Cortex and Databricks Genie agents, a conversation's workflow is its space's scope workflow, null on the agent-wide space. Read-only: the payload's run uuid names no run.

Arguments

ArgumentTypeDescription
agentNameString!Observability agent name.
traceTableMconString!MCON of the agent's trace table — same value passed as traceTableMcon on getAgentGraph. Disambiguates agents with identical names across trace tables.
startTimeDateTime!Include conversations labeled at or after this instant.
endTimeDateTime!Include conversations labeled at or before this instant.
limitInt!Most distinct conversations across all Issue spaces, oldest label first. At most 200. Default: 100.

Returns

[ReinforcementLoopDiagnosisTrigger!]!

Example

query GetReinforcementLoopDiagnosisTriggers($agentName: String!, $traceTableMcon: String!, $startTime: DateTime!, $endTime: DateTime!, $limit: Int!) {
  getReinforcementLoopDiagnosisTriggers(agentName: $agentName, traceTableMcon: $traceTableMcon, startTime: $startTime, endTime: $endTime, limit: $limit) {
    issueSpaceUuid
    scopeWorkflow
    conversationCount
    truncated
    skippedCount
    payload
  }
}

Types used only by getReinforcementLoopDiagnosisTriggers

ReinforcementLoopDiagnosisTrigger

Object type. The payload the reinforcement loop would send its diagnosis agent for one Issue space's labeled conversations. Nothing is recorded, so the run uuid names no run.

FieldTypeDescription
issueSpaceUuidUUID!
scopeWorkflowStringThe Issue space's workflow; null for the agent-wide space.
conversationCountInt!Conversations in the payload.
truncatedBoolean!The limit or the page cap ran out before this space was read to the end of the window.
skippedCountInt!Labeled conversations left out: no recent turns, a label without run provenance, a workflow outside the space, conflicting labels or a manifest the contract refuses.
payloadGenericScalarThe dispatch input, one entry in conversations per conversation with every cluster it matched. Null when no conversation qualified.

Related types

DateTime, GenericScalar, UUID

getReinforcementLoopGithubRepos (query)

getReinforcementLoopGithubRepos 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: Deprecated: Use getReinforcementLoopCodeRepos.

DEPRECATED. The names of the repos a GitHub App installation can read, sorted. The values repo on updateReinforcementLoopAgent's githubCodeRepos accepts.

Arguments

ArgumentTypeDescription
installationUuidUUID!One of the account's GitHub App installations.

Returns

[String!]!

Example

query GetReinforcementLoopGithubRepos($installationUuid: UUID!) {
  getReinforcementLoopGithubRepos(installationUuid: $installationUuid)
}

Related types

UUID

getReinforcementLoopSelectors (query)

getReinforcementLoopSelectors 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 reinforcement loop's Issue-cluster selectors for one agent, with the clusters available to select. One per Issue space, the agent-wide one first, then each workflow-scoped one; a space without saved settings reports the defaults.

Arguments

ArgumentTypeDescription
agentNameString!Observability agent name.
traceTableMconString!MCON of the agent's trace table — same value passed as traceTableMcon on getAgentGraph. Disambiguates agents with identical names across trace tables.

Returns

[ReinforcementLoopSelector!]!

Example

query GetReinforcementLoopSelectors($agentName: String!, $traceTableMcon: String!) {
  getReinforcementLoopSelectors(agentName: $agentName, traceTableMcon: $traceTableMcon) {
    issueSpaceUuid
    agentName
    traceTableMcon
    scopeWorkflow
    selectedClusterKeys
    selectsAllClusters
    isEnabled
    evalScoreThreshold
  }
}

Related types

ReinforcementLoopSelector

Source: The GraphQL API reference

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