Skip to main content

Flux MCP Tools

Tools available in the Flux MCP server for custom metrics and events tracking.

flux_track

Track a custom event.

Parameters

NameTypeRequiredDescription
namestringYesEvent name
valuenumberNoNumeric value
propertiesobjectNoEvent properties
tagsobjectNoIndexed tags
user_idstringNoUser identifier

Examples

“Track a user signup event”
flux_track(
  name: "user.signup",
  properties: { plan: "pro", source: "landing_page" },
  user_id: "user_123"
)
“Track a purchase with value”
flux_track(
  name: "order.placed",
  value: 99.99,
  properties: { product: "widget", quantity: 2 },
  tags: { currency: "USD", region: "us-east" }
)

flux_query

Query events with filters.

Parameters

NameTypeRequiredDescription
namestringNoEvent name (exact or pattern with *)
fromstringNoStart time (e.g., “1h ago”, “2024-01-01”)
tostringNoEnd time
user_idstringNoFilter by user
tagsobjectNoFilter by tags
limitnumberNoMax results
aggregationstringNocount, sum, avg
group_bystringNoGroup by field

Examples

“How many signups this week?”
flux_query(
  name: "user.signup",
  from: "7d ago",
  aggregation: "count"
)
“Show signups by plan”
flux_query(
  name: "user.signup",
  from: "30d ago",
  aggregation: "count",
  group_by: "tags.plan"
)
“What’s the total order value today?”
flux_query(
  name: "order.placed",
  from: "today",
  aggregation: "sum"
)
“Show recent events for user_123”
flux_query(
  user_id: "user_123",
  from: "24h ago",
  limit: 20
)

flux_metric

Get metric values and time series.

Parameters

NameTypeRequiredDescription
namestringYesMetric name
aggregationstringNoAggregation: last, avg, sum, p50, p95, p99
fromstringNoStart time
tostringNoEnd time
intervalstringNoTime bucket: 1m, 5m, 1h, 1d
tagsobjectNoFilter by tags

Examples

“How many users are online?”
flux_metric(name: "users.online", aggregation: "last")
“What’s the P95 response time?”
flux_metric(
  name: "response_time",
  aggregation: "p95",
  from: "1h ago"
)
“Show response time over the last 24 hours”
flux_metric(
  name: "response_time",
  aggregation: "p95",
  from: "24h ago",
  interval: "1h"
)
“Get API requests for /users endpoint”
flux_metric(
  name: "api.requests",
  aggregation: "sum",
  from: "1h ago",
  tags: { endpoint: "/users" }
)

flux_dashboard

Get dashboard data with widget values.

Parameters

NameTypeRequiredDescription
idstringNoDashboard ID (lists all if not provided)
namestringNoDashboard name (partial match)
time_rangestringNoOverride time range

Examples

“Show me all dashboards”
flux_dashboard()
“Get the API monitoring dashboard”
flux_dashboard(name: "API Monitoring")
“Show dashboard data for the last 24 hours”
flux_dashboard(id: "dash_abc123", time_range: "24h")
Returns all widgets with their current values:
  • Number widgets: current value with comparison
  • Graph widgets: time series data
  • Bar/Pie widgets: grouped values
  • Table widgets: tabular data

flux_anomalies

List detected anomalies.

Parameters

NameTypeRequiredDescription
statusstringNoactive, acknowledged, resolved, all
severitystring/arrayNoinfo, warning, critical
typestringNospike, drop, trend
metricstringNoFilter by metric name
fromstringNoStart time
limitnumberNoMax results

Examples

“Are there any anomalies?”
flux_anomalies(status: "active")
“Show critical anomalies from today”
flux_anomalies(
  status: "active",
  severity: "critical",
  from: "today"
)
“Any spikes in API requests?”
flux_anomalies(
  type: "spike",
  metric: "api.requests",
  from: "24h ago"
)
“Show all anomalies from this week”
flux_anomalies(
  status: "all",
  from: "7d ago"
)
Returns for each anomaly:
  • Type (spike, drop, trend)
  • Severity (info, warning, critical)
  • Affected metric
  • Current vs baseline value
  • Deviation percentage
  • Detection timestamp

Common Patterns

Business Intelligence

// Daily signups
flux_query(name: "user.signup", from: "30d ago", aggregation: "count", group_by: "day")

// Revenue by region
flux_query(name: "order.placed", aggregation: "sum", group_by: "tags.region")

// Conversion funnel
flux_query(name: "funnel.*", from: "7d ago", aggregation: "count", group_by: "name")

System Monitoring

// Current system state
flux_metric(name: "users.online")
flux_metric(name: "jobs.queue_depth")

// Performance trends
flux_metric(name: "response_time", aggregation: "p95", from: "24h ago", interval: "1h")

// Check for issues
flux_anomalies(status: "active", severity: ["warning", "critical"])

Debugging

// Recent events for a user
flux_query(user_id: "user_123", from: "1h ago")

// Track a debug event
flux_track(name: "debug.test", properties: { message: "Testing flux" })