OpsTrailsDocs
Console

MCP Tools Reference

The OpsTrails MCP server exposes 8 tools that AI assistants use to query your operational timeline and analyze metrics.


get_organization_context

Returns a description of what the organization tracks and how they use each field. This is always called first to understand the data model.

Parameters: None

Returns: Organization context including plan limits, data retention period, quota usage, and field descriptions.


query_events

Search and filter infrastructure events. The primary tool for investigating what happened.

ParameterTypeDescription
fromstringStart of time range. Relative ("-2h", "-7d") or ISO 8601.
tostringEnd of time range. Defaults to now.
typestringFilter by event type (e.g. "deployment").
sourcestringFilter by event source.
severitystringFilter by severity: LOW, MINOR, MAJOR, CRITICAL.
searchstringFree-text search across type, version, source.
limitnumberMax events to return (1-100, default 25).
timezonestringIANA timezone for bare datetimes (e.g. "Europe/Warsaw").

Example

json
{
  "from": "-6h",
  "type": "deployment",
  "severity": "CRITICAL",
  "limit": 10
}

get_event_summary

High-level overview of operational activity in a time period. Event counts grouped by type plus recent events.

ParameterTypeDescription
fromstringStart of time range (required).
tostringEnd of time range (required).
timezonestringIANA timezone for bare datetimes.

list_event_types

List all distinct event types recorded (e.g. deployment, rollback, data-load). Useful to discover what kinds of operations are tracked.

Parameters: None


list_event_sources

List all distinct event sources recorded (e.g. GitHub repos, CI/CD pipelines, services).

Parameters: None


list_event_subjects

List all distinct event subjects recorded (e.g. production, staging, specific servers).

Parameters: None


get_metrics_around_event

Get stability/performance metrics in a window before and after a given time. Use this after finding an event to assess its impact.

ParameterTypeDescription
timestringReference time to compare around (required). ISO 8601 or relative.
windowstringComparison window size: 1h, 2h, 4h, 6h, 12h, 24h. Default: 2h.
namestringFilter to a specific metric name (e.g. "error_rate").
subjectstringFilter by subject/environment (e.g. "production").
timezonestringIANA timezone for bare datetimes.

Example

json
{
  "time": "2025-01-15T14:30:00Z",
  "window": "2h",
  "name": "error_rate",
  "subject": "production"
}

list_metric_names

List all distinct metric names available with their units and data point counts. Use this to discover what metrics are tracked before calling get_metrics_around_event.

Parameters: None