Skip to content

Tools Reference

KubeOpsAI edited this page Aug 23, 2026 · 1 revision

Tools Reference

The server exposes 12 tools across four categories. Your AI assistant selects and calls these automatically.

Log Tools (Loki)

query_pod_logs

Retrieves raw logs from a specific pod or set of pods. All output is automatically sanitized.

Parameter Type Default Description
pod_name string required Pod name or regex pattern
namespace string default Kubernetes namespace
container string none Filter to a specific container
timeframe_minutes integer 60 Minutes of logs to retrieve
limit integer 100 Max log lines (capped at 500)

query_logs_custom

Executes a raw LogQL query directly against Loki.

Parameter Type Default Description
query string required Valid LogQL query
timeframe_minutes integer 60 Time range
limit integer 100 Max log lines

Metrics Tools (Prometheus)

get_pod_metrics

Retrieves a specific metric type for a pod using pre-built PromQL queries.

Parameter Type Default Description
pod_name string required Pod name or regex pattern
namespace string default Kubernetes namespace
metric_type string cpu One of: cpu, memory, restarts, network_rx, network_tx

query_prometheus

Executes a raw PromQL query.

Parameter Type Default Description
query string required Valid PromQL expression
range_query boolean false Get values over time instead of instant
timeframe_minutes integer 60 Time range for range queries
step string 1m Resolution step (e.g., 1m, 5m, 1h)

get_cluster_health

Returns a snapshot of overall cluster health. No parameters required.

Returns: node_count, pod_count, running_pods, failed_pods, pending_pods, cpu_utilization, memory_utilization.


Trace Tools (Tempo)

get_trace

Retrieves a complete distributed trace by its trace ID.

Parameter Type Default Description
trace_id string required Hex trace ID, 16–32 characters

search_traces

Searches for traces matching a combination of filters.

Parameter Type Default Description
service_name string none Filter by service name
operation string none Filter by operation/span name
tags object none Filter by span tags as key-value pairs
min_duration string none Minimum trace duration (e.g., 100ms, 1s)
max_duration string none Maximum trace duration
timeframe_minutes integer 60 How far back to search
limit integer 20 Max traces to return (max 100)

Analytics Tools

analyze_logs

Fetches logs and runs pattern analysis to detect errors, categorize them, and generate recommendations.

Parameter Type Default Description
service_name string required Service or pod name
namespace string default Kubernetes namespace
timeframe_minutes integer 60 Time window
limit integer 500 Max log lines to analyze

build_incident_timeline

Builds a unified chronological timeline correlating logs, metrics, and traces.

Parameter Type Default Description
service_name string required Affected service name
namespace string default Kubernetes namespace
timeframe_minutes integer 60 Time window

enrich_alert

Gathers full context when an alert fires: logs, metrics, traces, and suggested queries.

Parameter Type Default Description
alert_name string required Name of the alert that fired
service_name string required Affected service
namespace string default Kubernetes namespace
timeframe_minutes integer 30 Context window (max 60)

get_resource_costs

Calculates resource cost attribution by namespace based on CPU and memory usage.

Parameter Type Default Description
namespace string none Filter to a namespace (omit for all)
timeframe_minutes integer 60 Usage averaging window

Cost estimates use approximate rates ($0.05/core-hour CPU, $0.01/GB-hour memory) for relative comparison only. Refer to AWS Cost Explorer for authoritative figures.

check_slo_status

Checks SLO compliance including error budget remaining and burn rate.

Parameter Type Default Description
service_name string required Service to check
namespace string default Kubernetes namespace
availability_target float 0.999 Target availability (e.g., 0.999 = 99.9%)
latency_target_ms float 500.0 Target latency in milliseconds
latency_percentile float 0.99 Latency percentile (e.g., 0.99 = p99)
window_hours integer 24 Measurement window in hours (1–720)

Clone this wiki locally