CubeAPM MCP Server
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| CUBEAPM_URL | No | Full URL to CubeAPM (e.g., https://cube.example.com). Takes precedence over CUBEAPM_HOST/CUBEAPM_QUERY_PORT/CUBEAPM_INGEST_PORT settings. | |
| CUBEAPM_HOST | No | CubeAPM server hostname or IP. Used if CUBEAPM_URL is not set. | localhost |
| CUBEAPM_QUERY_PORT | No | Port for querying APIs (traces, metrics, logs). | 3140 |
| CUBEAPM_INGEST_PORT | No | Port 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
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
| prompts | {
"listChanged": true
} |
| resources | {
"listChanged": true
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| query_logsA | Query logs from CubeAPM using LogsQL syntax (VictoriaLogs compatible). Returns log entries matching the query. IMPORTANT - Log Label Discovery:
LogsQL Query Syntax:
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:
|
| 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:
HISTOGRAM QUERIES (P50, P90, P95, P99):
Example queries:
|
| 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:
HISTOGRAM QUERIES (P50, P90, P95, P99):
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:
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):
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
| Name | Description |
|---|---|
| investigate-service | Investigate issues with a specific service - checks errors, latency, and recent traces |
| check-latency | Check P50, P95, and P99 latency percentiles for a service |
| find-slow-traces | Find the slowest traces for a service to identify performance bottlenecks |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
| config | Current CubeAPM connection configuration |
| query-patterns | CubeAPM-specific query patterns and naming conventions |
TDQS
Scored across 6 tools
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.
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.
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.
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.