@last9/mcp-server
Advanced tools
| #!/usr/bin/env bash | ||
| set -euo pipefail | ||
| SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| REPO_DIR="$(dirname "$SCRIPT_DIR")" | ||
| # Load .env if present (sets LAST9_REFRESH_TOKEN etc.) | ||
| if [[ -f "$REPO_DIR/.env" ]]; then | ||
| set -a | ||
| source "$REPO_DIR/.env" | ||
| set +a | ||
| fi | ||
| exec "$REPO_DIR/last9-mcp" "$@" |
+1
-1
| { | ||
| "name": "@last9/mcp-server", | ||
| "version": "0.7.2", | ||
| "version": "0.9.0", | ||
| "description": "Last9 MCP Server - Model Context Protocol server implementation for Last9", | ||
@@ -5,0 +5,0 @@ "bin": { |
+49
-2
@@ -265,3 +265,4 @@ # Last9 MCP Server | ||
| - **`get_service_logs`** — Raw log lines for a service, filterable by severity and body content | ||
| - **`get_log_attributes`** — Available attributes in the log schema for a time window | ||
| - **`get_log_attributes`** — Global catalog of attributes in the log schema for a time window | ||
| - **`get_log_attributes_for_pipeline`** — Log fields actually present for an in-progress pipeline (scoped discovery), each with its exact `filter_field` | ||
| - **`get_drop_rules`** — Log drop rules from [Last9 Control Plane](https://last9.io/control-plane) | ||
@@ -274,3 +275,5 @@ - **`add_drop_rule`** — Create a new drop rule to cut log volume at the source | ||
| - **`get_service_traces`** — Traces by exact trace ID or service name. Use this when you have a trace ID — it's faster | ||
| - **`get_trace_attributes`** — Available attributes in the trace schema | ||
| - **`get_trace_attributes`** — Global catalog of attributes in the trace schema | ||
| - **`get_trace_attributes_for_pipeline`** — Attributes actually present for an in-progress pipeline (scoped discovery), each with its exact `filter_field` | ||
| - **`get_trace_attribute_values`** — Distinct values for a trace attribute, optionally scoped to a pipeline | ||
@@ -282,2 +285,3 @@ ### Change Events & Alerts | ||
| - **`get_alerts`** — Currently firing alerts within a time window | ||
| - **`get_alert_rule_state`** — Historical firing state (1/0) per alert rule over a time range, grouped by `rule_id`. Filterable by alert group, rule name, label filters, and state. | ||
| - **`get_notification_channels`** — Configured notification channels (Slack, PagerDuty, email, etc.) | ||
@@ -509,2 +513,10 @@ | ||
| For log-based service inventory, query `physical_index_service_count` first: | ||
| ```promql | ||
| sum by (name, service_name, env) (physical_index_service_count{destination="logs"}) | ||
| ``` | ||
| Use `service_name` as `ServiceName`, `env` as the environment when present, and `name` as the physical index name. If `name="default"`, omit `index`; for a non-default physical index selected by the user, pass `index: "physical_index:<name>"`. If the backend rejects explicit physical index filtering, retry without `index` and report that explicit physical index filtering is unavailable for that backend. | ||
| ### get_service_logs | ||
@@ -522,2 +534,3 @@ | ||
| Multiple filter types combine with AND. Each array uses OR internally. | ||
| Use `get_logs` for broad aggregate counts first; use `get_service_logs` only after narrowing to a service/env/index and a small sample set. | ||
@@ -531,2 +544,10 @@ ### get_log_attributes | ||
| ### get_log_attributes_for_pipeline | ||
| - `pipeline` (array, required): Prior filter stages to scope discovery, e.g. `[{"type":"filter","query":{"$eq":["ServiceName","<service>"]}}]`. | ||
| - `lookback_minutes` (integer, optional): Default: 15. | ||
| - `start_time_iso` / `end_time_iso` (string, optional) | ||
| - `region` (string, optional) | ||
| - `index` (string, optional) | ||
| ### get_drop_rules | ||
@@ -567,2 +588,15 @@ | ||
| ### get_trace_attributes_for_pipeline | ||
| - `pipeline` (array, required): Prior filter stages to scope discovery, e.g. `[{"type":"filter","query":{"$eq":["ServiceName","<service>"]}}]`. | ||
| - `lookback_minutes` (integer, optional): Default: 15. | ||
| - `start_time_iso` / `end_time_iso` (string, optional) | ||
| - `region` (string, optional) | ||
| ### get_trace_attribute_values | ||
| - `tag_name` (string, required): Attribute name from `get_trace_attributes` (e.g. `resource_department` or `attributes['http.method']`). | ||
| - `pipeline` (array, optional): Prior filter stages to scope the values; omit for global values. | ||
| - `region` (string, optional) | ||
| ### get_change_events | ||
@@ -591,2 +625,15 @@ | ||
| ### get_alert_rule_state | ||
| - `start_time` (integer, required): Unix epoch start of the range (inclusive). | ||
| - `end_time` (integer, required): Unix epoch end of the range (inclusive). | ||
| - `step` (integer, required): Resolution in seconds between samples. The number of samples `((end_time - start_time) / step + 1)` is capped at 100. | ||
| - `alert_group_id` (string, optional): Filter by alert group ID. | ||
| - `rule_name` (string, optional): Regex filter on rule name. | ||
| - `alert_group_name` (string, optional): Regex filter on alert group name. | ||
| - `label_filters` (string, optional): Comma-separated `key=value` label filters. | ||
| - `state` (string, optional): Filter by state (e.g. `firing`). | ||
| Returns a JSON map of `rule_id -> [{timestamp, is_firing}]`. A timestamp at which a rule is absent from the upstream response is reported as `is_firing=0` — this means "not observed as firing", not a confirmed normal state. | ||
| ### get_notification_channels | ||
@@ -593,0 +640,0 @@ |
41566
9.26%6
20%677
7.46%