Skip to main content
Glama
CubeAPM MCP Server

CubeAPM MCP Server

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
CUBEAPM_URLNoFull URL to CubeAPM (e.g., https://cube.example.com). Takes precedence over CUBEAPM_HOST/CUBEAPM_QUERY_PORT/CUBEAPM_INGEST_PORT settings.
CUBEAPM_HOSTNoCubeAPM server hostname or IP. Used if CUBEAPM_URL is not set.localhost
CUBEAPM_QUERY_PORTNoPort for querying APIs (traces, metrics, logs).3140
CUBEAPM_INGEST_PORTNoPort for ingestion APIs.3130

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

This server publishes no instructions, or was last inspected before Glama recorded them.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": true
}
prompts
{
  "listChanged": true
}
resources
{
  "listChanged": true
}

Tools

Functions exposed to the LLM to take actions

NameDescription
query_logsA

Query logs from CubeAPM using LogsQL syntax (VictoriaLogs compatible). Returns log entries matching the query.

IMPORTANT - Log Label Discovery:

  • Labels vary by source! Use "*" query first to discover available labels

  • Lambda logs use: faas.name, faas.arn, env, aws.lambda_request_id

  • Service logs may use: service_name, level, host

  • NOT all sources have "service_name" - check the _stream field in results

LogsQL Query Syntax:

  • Wildcard (discover labels): *

  • Stream filters: {faas.name="my-lambda-prod"}

  • Text search: {faas.name="webhook-lambda-prod"} AND "error"

  • Regex match: {faas.name=~".*-prod"}

  • Negation: {faas.name!="unwanted-service"}

  • Combine filters: {env="UNSET", faas.name=~".-lambda."}

PIPE OPERATORS — chain after query with "|": | copy src_field AS dst_field — copy field value | drop field1, field2 — remove fields from output | extract_regexp "(?Pregex)" — extract fields via named capture groups | join by (field) (...subquery...) — join with subquery results | keep field1, field2 — keep only specified fields | limit N — return at most N results | math result = field1 + field2 — compute derived fields (+, -, *, /, %) | rename src AS dst — rename a field | replace (field, "old", "new") — replace substring in field | replace_regexp (field, "re", "replacement") — regex replacement | sort by (field) [asc|desc] — sort results | stats as alias [by (group_fields)] — aggregate results | unpack_json — extract fields from JSON log body

STATS FUNCTIONS (use with | stats pipe): avg(field) — arithmetic mean count() — total number of matching entries count_empty(field) — count entries where field is empty count_uniq(field) — count distinct values max(field) — maximum value median(field) — median (50th percentile) min(field) — minimum value quantile(p, field) — p-th quantile (e.g., quantile(0.95, duration)) sum(field) — sum of values

Example queries:

  • All logs (discover structure): *

  • Lambda logs: {faas.name="webhook-lambda-prod"}

  • Search errors: {faas.name=~".*"} AND "error"

  • By environment: {env="production"}

  • Count errors per function: {faas.name=~".*"} AND "error" | stats count() as error_count by (faas.name)

  • Top 10 slowest: {service_name="my-service"} | sort by (duration) desc | limit 10

query_metrics_instantA

Execute an instant query against CubeAPM metrics at a single point in time. Uses PromQL-compatible syntax (VictoriaMetrics flavor).

IMPORTANT - CubeAPM Metric Naming Conventions:

  • Metrics use "cube_apm_" prefix (e.g., cube_apm_calls_total, cube_apm_latency_bucket)

  • Service label is "service" (NOT "server" or "service_name")

  • Common labels: env, service, span_kind (server|client|consumer|producer), status_code, http_code

HISTOGRAM QUERIES (P50, P90, P95, P99):

  • CubeAPM uses VictoriaMetrics-style histograms with "vmrange" label (NOT Prometheus "le" buckets)

  • Use histogram_quantiles() function instead of histogram_quantile()

  • Syntax: histogram_quantiles("phi", 0.95, sum by (vmrange) (increase(cube_apm_latency_bucket{...}[5m])))

  • Latency values are returned in SECONDS (0.05 = 50ms)

Example queries:

  • P95 latency: histogram_quantiles("phi", 0.95, sum by (vmrange, service) (increase(cube_apm_latency_bucket{service="MyService", span_kind="server"}[5m])))

  • Error rate: sum by (service) (increase(cube_apm_calls_total{status_code="ERROR"}[1h])) / sum by (service) (increase(cube_apm_calls_total[1h])) * 100

  • List services: count by (service) (cube_apm_calls_total{env="UNSET"})

  • Request count: sum by (service) (increase(cube_apm_calls_total{span_kind=~"server|consumer"}[1h]))

query_metrics_rangeA

Execute a range query against CubeAPM metrics over a time range. Returns time series data. Uses PromQL-compatible syntax (VictoriaMetrics flavor).

IMPORTANT - CubeAPM Metric Naming Conventions:

  • Metrics use "cube_apm_" prefix (e.g., cube_apm_calls_total, cube_apm_latency_bucket)

  • Service label is "service" (NOT "server" or "service_name")

  • Common labels: env, service, span_kind (server|client|consumer|producer), status_code, http_code

HISTOGRAM QUERIES (P50, P90, P95, P99):

  • CubeAPM uses VictoriaMetrics-style histograms with "vmrange" label (NOT Prometheus "le" buckets)

  • Use histogram_quantiles() function instead of histogram_quantile()

  • Syntax: histogram_quantiles("phi", 0.95, sum by (vmrange, service) (increase(cube_apm_latency_bucket{...}[5m])))

  • Latency values are returned in SECONDS (0.05 = 50ms)

Example range query for P95 over time: histogram_quantiles("phi", 0.95, sum by (vmrange, service) (increase(cube_apm_latency_bucket{service="MyService", span_kind="server"}[5m])))

search_tracesA

Search for traces in CubeAPM matching the specified criteria. Returns trace snippets with key spans.

IMPORTANT - Required Parameters:

  • query, env, service, start, end are ALL REQUIRED by CubeAPM API

  • Use query="*" for wildcard search

  • Use env="UNSET" if environment is not configured

  • Service names are case-sensitive (e.g., "Kratos-Prod" not "kratos")

TRACE QUERY SYNTAX: The query parameter supports pipe syntax similar to LogsQL: {stream_selector} | pipe1 | pipe2

Stream selectors filter spans: {service="Kratos-Prod"} {service="Kratos-Prod", span_kind="server"} {http_code=~"5.."}

PIPE OPERATORS — same as LogsQL pipes: | copy, | drop, | extract_regexp, | join, | keep, | limit, | math, | rename, | replace, | replace_regexp, | sort, | stats as alias [by (group_fields)], | unpack_json

STATS FUNCTIONS (for aggregate trace analysis): avg(field) — arithmetic mean count() — total matching spans count_uniq(field) — distinct values max(field) — maximum value median(field) — median value min(field) — minimum value quantile(p, field) — p-th quantile (e.g., quantile(0.95, duration)) sum(field) — sum of values

IMPORTANT: Duration in traces is in MILLISECONDS. IMPORTANT: "p95" is NOT a valid function — use quantile(0.95, duration).

Example queries: Wildcard: query="*" P95 latency: query='{service="Kratos-Prod", span_kind="server"} | stats quantile(0.95, duration) as p95_latency' Error count by endpoint: query='{service="Kratos-Prod", status_code="ERROR"} | stats count() as errors by (http_route)' Slow spans: query='{service="Kratos-Prod"} | sort by (duration) desc | limit 20'

Optional filters (applied in addition to query):

  • spanKind: server, client, consumer, producer

  • sortBy: duration (to find slow traces)

To discover available service names, first query metrics: count by (service) (cube_apm_calls_total{env="UNSET"})

get_traceA

Fetch a complete trace by its ID from CubeAPM. Returns all spans in the trace with full details.

ingest_metrics_prometheusC

Send metrics to CubeAPM in Prometheus text exposition format.

Prompts

Interactive templates invoked by user choice

NameDescription
investigate-serviceInvestigate issues with a specific service - checks errors, latency, and recent traces
check-latencyCheck P50, P95, and P99 latency percentiles for a service
find-slow-tracesFind the slowest traces for a service to identify performance bottlenecks

Resources

Contextual data attached and managed by the client

NameDescription
configCurrent CubeAPM connection configuration
query-patternsCubeAPM-specific query patterns and naming conventions

TDQS

A3.7/5.0

Scored across 6 tools

Disambiguation4/5

Each tool targets a distinct telemetry type or operation: logs, trace search, trace fetch, instant metrics, range metrics, and metric ingestion. The only mild overlap is between query_metrics_instant and query_metrics_range, but the temporal distinction is standard and clearly described. search_traces versus get_trace is also well separated by search-vs-fetch semantics.

Naming Consistency4/5

All names use snake_case and are verb-first, which is highly consistent. The minor deviation is using both 'query_' and 'search_' verbs for similar read operations, plus multi-word qualifiers like '_instant', '_range', and '_prometheus', but the pattern remains easy to predict and read.

Tool Count5/5

Six tools is well-scoped for an APM server covering logs, traces, metrics, and metric ingestion. Each tool has a clear purpose and the surface does not feel bloated or excessively thin.

Completeness4/5

The core observability workflows are covered: querying logs, searching and fetching traces, querying metrics, and ingesting metrics. Minor gaps include no explicit service/environment discovery tool or log/trace ingestion endpoint, but agents can work around these using wildcard queries and metric label counts as described.

Maintenance

ActivityInactive
ResponsivenessNo recent community issues