mcp-vmanomaly
v0.7.0MCP Server for vmanomaly - VictoriaMetrics anomaly detection
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
vmanomaly_cancel_autotune_task
Request cooperative cancellation of a running shared autotune task.
| Parameter | Type | Description |
|---|---|---|
task_id * | string | Autotune task identifier returned by vmanomaly_create_autotune_task |
vmanomaly_check_compatibility
Check if persisted vmanomaly state is compatible with the current or target runtime version. Returns compatibility status and required migration actions.
| Parameter | Type | Description |
|---|---|---|
version_to | string | Optional target version to check compatibility against. If omitted, checks against current runtime version. |
vmanomaly_create_autotune_task
Start shared unsupervised autotune on sampled query results for one requested model class. Returns a task_id immediately. Use this after choosing a model class from vmanomaly_timeseries_characteristics, then poll vmanomaly_get_autotune_task until done. Pass the same step used for profiling and the final detect-anomalies task/config. Tell the user the budget and anomaly assumption before calling; MCP defaults to optimization_timeout=8, optimization_n_trials=32, and anomaly_percentage=0.02 unless overridden.
| Parameter | Type | Description |
|---|---|---|
tuned_class_name * | string | Model class or alias to tune. Call vmanomaly_list_models first for available models. Supports one expression or named queries with separate business policies. Tune the multivariate class directly for… |
anomaly_percentage | number | Expected anomaly fraction in the range [0 0.5) for unsupervised tuning (conservative MCP default: 0.02) |
datasource_type | string | Datasource type (default: 'vm') |
datasource_url | string | Optional VictoriaMetrics or VictoriaLogs datasource URL |
end | number | Optional query end timestamp as Unix seconds |
frozen_params | object | Top-level model parameters to freeze while tuning |
limit | integer | Sampled series cap for profiling and shared autotune (default: 100) |
optimization_n_trials | integer | Maximum Optuna trials. Use small values for interactive Copilot runs; MCP default is 32. |
optimization_params | object | Advanced tuning controls: n_trials timeout n_jobs n_splits train_val_ratio seed validation_scheme beta show_progress_bar gc_after_trial exact optimize_complexity. Set exact=true for online models when… |
optimization_timeout | number | Optimization timeout in seconds. Use small values for interactive Copilot runs; MCP default is 8. |
optimized_business_params | array | Legacy model-local business parameters to tune: detection_direction min_dev_from_expected min_rel_dev_from_expected. For vmanomaly v1.30.2+ prefer freezing stable policies during tuning and emitting t… |
pass_auth_headers | boolean | Forward MCP request authorization headers to datasource |
queries | object | Named expressions keyed by alias with optional per-query business policies. One shared study across all inputs; use frozen_params.groupby for multivariate or peer grouping. On v1.31.0+ peer_outlier ke… |
query | string | Legacy expression; provide exactly one of query or queries |
replay | object | Optional deployment-schedule evaluation on fixed start/end Unix timestamps with preceding fit history. Omit for fold-based tuning. Requires backend replay support; verify completed result_data.data.op… |
short_gap_steps | integer | Short gaps to interpolate during profiling (default: 2) |
start | number | Optional query start timestamp as Unix seconds |
step | string | Query step/resolution (default: '1s'; examples: '1m' '5m' '1h'). Use the same step from time-series characteristics and the final detect-anomalies task/config. |
tenant_id | string | Optional tenant ID for cluster datasources |
timezone | string | IANA timezone for profile-guided calendar hints |
use_profile_hints | boolean | Pass sampled time-series characteristics as search hints when the selected model search space supports them (default: true) |
vmanomaly_discover_metrics
Discover scoped metric names, labels or series using one bounded request. Supply selectors and a fixed time window. Returned counts are not exact cardinality; preserve completeness and warnings. Requires the discovery API; 404 means unsupported, not an empty inventory. No automatic retries or tenant enumeration.
| Parameter | Type | Description |
|---|---|---|
datasource_url * | string | Authorized VictoriaMetrics datasource URL; include any required path prefix. |
end * | number | Fixed window end as Unix seconds, greater than start and at most 31 days after it. |
match * | array | One to ten PromQL series selectors restricting discovery; each is at most 4096 UTF-8 bytes. |
operation * | string | Metadata to discover: metric names, label names, values of a named label, or series label sets. |
start * | number | Fixed window start as Unix seconds since the epoch; fractional seconds are accepted. |
label | string | Target label name, required and nonblank for label_values; omitted for other operations. |
limit | integer | Maximum returned items, 1 to 1000; omit for the server default of 100. Returned counts are not total cardinality. |
pass_auth_headers | boolean | Whether the server may forward incoming authentication headers to the datasource. Default false; enable only when credential forwarding to this datasource is authorized. |
tenant_id | string | Optional cluster tenant: accountID, accountID:projectID or multitenant. May be embedded in datasource_url; conflicting settings are rejected. Preserve the requested scope; never automatically broaden… |
timeout_seconds | number | Upstream metadata request timeout in seconds, up to 30; omit or use 0 for the server default of 10. |
vmanomaly_estimate_deployment_resources
Experimental vmanomaly deployment resource sizing, not monitored-metric forecasting or forecast_at. FORWARD sizing for a known entity_count: estimate required CPU, RAM, disk and fit/inference stage costs. When the user instead gives CPU/RAM and cadence without a series count, use vmanomaly_estimate_inference_capacity; do not ask for cardinality to make a forward request. For suspected OOM distinguish observed events from CrashLoopBackOff. For an existing single pod set options.deployment.members_count=1. Online models default to bootstrap only and advisory fit duration, retaining peak RAM/disk…
| Parameter | Type | Description |
|---|---|---|
workloads * | array | One to sixteen model workloads. State required history and sampling when known; defaults are two weeks of five-minute data. |
options | object | Additional capacity request fields: policy (cpu_candidates <= max_cpus_per_node, storage_mode, persist_models, ram_limit_bytes_per_node, margin_ratio, fit_budget_seconds, infer_budget_seconds (default… |
vmanomaly_estimate_inference_capacity
Experimental vmanomaly deployment inference capacity, not monitored-metric forecasting or forecast_at. REVERSE sizing: given CPUs, optional RAM limit and inference cadence, return approximate maximum active models per interval. Choose this for 'estimate capacity' with fixed resources and no series count. Active model/entity count is the OUTPUT: never request it as an input or invent it. For univariate models this is series count; multivariate entities are groups with channels_per_entity input series each. Report input_series separately. Clarify missing history or disclose a default; retain the…
| Parameter | Type | Description |
|---|---|---|
cpus * | integer | CPU/worker allocation on one instance, 1 through 256. |
infer_every_seconds * | number | Inference cadence in seconds, e.g. 300. |
model_class * | string | Concrete built-in model; mad/mad_online and zscore/zscore_online resolve to the same online classes. Prefer mad_online or zscore_online. |
options | object | Additional throughput fields: model_params, topology, channels_per_entity, history (window_seconds, step_seconds; optional fit_every_seconds; inclusive points=floor(window/step)+1), infer_points_per_c… |
ram_limit_bytes | integer | Optional container RAM limit, in bytes. Omit when unconstrained. |
vmanomaly_generate_alert_rule
Generate a VMAlert rule YAML configuration for anomaly score alerting. Creates an example vmalert rule that triggers when anomaly_score exceeds the threshold. Use this to set up alerting for anomalies detected by vmanomaly.
| Parameter | Type | Description |
|---|---|---|
query * | string | PromQL query to include in alert description |
step * | string | Query step/resolution (e.g. '1s' '1m' '5m') |
anomaly_threshold | number | Anomaly score threshold (default: 1.0) |
group_name | string | VMAlert rule group name (default: 'VMAnomalyAlerts') |
infer_every | string | Inference cadence (defaults to step value) |
rule_description | string | Custom alert description/summary |
rule_name | string | Custom alert rule name |
vmanomaly_generate_preset_artifacts
Render matching vmanomaly configuration and vmalert rules from a complete configuration. Preserves query policies and model/scheduler mappings. Supply a public incident base URL for investigation annotations. Schema-valid does not mean live-tested; retain all warnings. Requires the artifact API; do not retry unsupported targets or infer writer destinations.
| Parameter | Type | Description |
|---|---|---|
config * | object | Complete configuration including explicit reader, writer, models and schedulers. Use secret references rather than inline credentials. |
alerts | object | Optional alert policy. Omit to use backend defaults; generation does not deploy rules or test notification delivery. |
deployment | object | Optional deployment files. If target and storage are known, include them in the first generation call; do not generate a preliminary base-only bundle. Generate base files first only when target or sto… |
required_inputs | array | Unresolved draft fields: writer.datasource_url and/or writer.tenant_id. Use http://replace-me.invalid:8428 for an unknown writer URL and never probe it. The backend returns a required-input checklist… |
vmanomaly_get_autotune_task
Get a shared autotune task. While status is running, wait briefly before polling again and never issue concurrent duplicate polls. When status is done, use result_data.data.modelConfig and related result_data fields. Treat error and canceled as terminal.
| Parameter | Type | Description |
|---|---|---|
task_id * | string | Autotune task ID returned by creation |
wait_seconds | integer | Wait up to this many seconds for completion (default 0: immediate). Prefer 10 to avoid repeated LLM polling turns. Returns latest status if still running; never creates a new task. |
vmanomaly_get_buildinfo
Get vmanomaly server build information including version number, build timestamp, and Go version. Use this to verify server version, check compatibility, or troubleshoot issues by confirming which version is running.
vmanomaly_get_deployment_sizing_profiles
List shipped experimental deployment-sizing model/parameter profiles, target versions and CPU reference. Use to discover calibrated configurations before sizing; unavailable on older servers.
vmanomaly_get_metrics
Get currently instant Prometheus-formatted self-monitoring metrics from vmanomaly server. Returns operational metrics including reader/writer performance, model execution stats, system info, and resource usage. Output is in standard Prometheus text exposition format suitable for scraping or monitoring analysis.
vmanomaly_get_model_schema
Get the complete JSON schema for a UI-compatible model type returned by vmanomaly_list_models. Returns parameters, types, validation rules, defaults, and descriptions. Multivariate models are intentionally unavailable from this UI-oriented endpoint; configure them outside VMUI using documentation and validate the complete model config.
| Parameter | Type | Description |
|---|---|---|
model_class * | string | UI-compatible model class or alias returned by vmanomaly_list_models. Multivariate models are intentionally unavailable from this UI-oriented schema endpoint. |
vmanomaly_get_preset_guide
Retrieve the versioned workflow for building an anomaly-detection preset from discovered signals. Call before starting a preset request, including node-exporter onboarding. Covers bounded discovery, profiling, model selection, sizing, missing destinations and generating downloadable config/alert artifacts. Does not query data or modify configuration.
vmanomaly_get_server_models
Get configured server models and their query attachments. Returns runtime model aliases, model configuration, attached queries, and model metadata from the vmanomaly server.
vmanomaly_get_server_queries
Get query aliases and MetricsQL/LogsQL expressions configured on the running vmanomaly server.
vmanomaly_health_check
Check the health status of the vmanomaly server
vmanomaly_list_models
List model types exposed to VMUI and other UI-oriented configuration flows. Use this before selecting a model in UI, then call vmanomaly_get_model_schema. Experimental multivariate models may be included depending on the connected server version. Use its response as the source of truth.
vmanomaly_read_doc_section
Read a bounded documentation section by source URI and character offset returned by search. Follow next_offset for continuation; fetch relevant sections before relying on truncated guidance.
| Parameter | Type | Description |
|---|---|---|
uri * | string | Exact documentation URI returned by search |
limit | integer | Character count |
offset | integer | Zero-based character offset (default 0) |
vmanomaly_search_docs
Search vmanomaly documentation using full-text search with fuzzy matching. Returns ranked excerpts with source URIs and character offsets. Use vmanomaly_read_doc_section for additional text; excerpts are not complete documentation. Use this when you need information about model parameters, configuration syntax, troubleshooting, or feature explanations.
| Parameter | Type | Description |
|---|---|---|
query * | string | Search query for vmanomaly documentation. Supports keywords phrases or natural language questions. Example queries: 'temporal envelope parameters' 'how to configure seasonality' 'online models' 'insta… |
limit | number | Maximum number of documentation resources to return. Range: 1-100. Default: 5. Ranking and requested top-k are preserved; excerpts share a bounded text budget. |
vmanomaly_timeseries_characteristics
Profile a sampled set of time series returned by a query. Returns compact batch characteristics such as detected seasonalities, trend share, flatness/spikiness, coverage, and sampling stats. Use this before recommending a model from data rather than from a manual description.
| Parameter | Type | Description |
|---|---|---|
query * | string | PromQL or LogsQL query to profile on sampled time series |
datasource_type | string | Datasource type (default: 'vm') |
datasource_url | string | Optional VictoriaMetrics or VictoriaLogs datasource URL |
end | number | Optional query end timestamp as Unix seconds |
limit | integer | Sampled series cap for profiling (default: 100) |
pass_auth_headers | boolean | Forward MCP request authorization headers to datasource |
short_gap_steps | integer | Short gaps to interpolate during profiling (default: 2) |
start | number | Optional query start timestamp as Unix seconds |
step | string | Query step/resolution (default: '1s'; examples: '1m' '5m' '1h'). Use the same step that will be used for autotune and the final detect-anomalies task/config. |
tenant_id | string | Optional tenant ID for cluster datasources |
timezone | string | IANA timezone for calendar profiling |
verbose | boolean | Include expanded aggregate diagnostics without per-series identifiers. Prefer false for a compact response. |
vmanomaly_validate_config
Validate the schema of a complete vmanomaly YAML configuration. Takes a full configuration object (with reader, schedulers, models, writer sections) and returns validation result with normalized config or error details. Schema validation does not establish deployment readiness; perform separate deployment rendering and live checks.
| Parameter | Type | Description |
|---|---|---|
config * | object | Complete vmanomaly configuration object to validate. Must include all required sections: 'reader' (data source) 'schedulers' (timing) 'models' (detection algorithms) and 'writer' (output destination).… |
vmanomaly_validate_model_config
Validate the schema of an anomaly detection model configuration. This does not assess model fit, data compatibility or deployment readiness. Returns validation result with the normalized/validated configuration or detailed error messages if invalid. Use this after building your model config to catch configuration errors before creating a detection task with vmanomaly_create_detection_task.
| Parameter | Type | Description |
|---|---|---|
model_spec * | object | Model configuration object to validate. Must include 'class' plus model-specific parameters. Use vmanomaly_list_models and vmanomaly_get_model_schema to discover available models |