Thanos · Capability

Thanos Query API — Rules

Thanos Query API — Rules. 2 operations. Lead operation: Get Active Alerts. Self-contained Naftiko capability covering one Thanos business surface.

Run with Naftiko ThanosRules

What You Can Do

GET
Getalerts — Get Active Alerts
/v1/api/v1/alerts
GET
Getrules — Get Alerting and Recording Rules
/v1/api/v1/rules

MCP Tools

get-active-alerts

Get Active Alerts

read-only idempotent
get-alerting-and-recording-rules

Get Alerting and Recording Rules

read-only idempotent

Capability Spec

query-rules.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: Thanos Query API — Rules
  description: 'Thanos Query API — Rules. 2 operations. Lead operation: Get Active Alerts. Self-contained Naftiko capability
    covering one Thanos business surface.'
  tags:
  - Thanos
  - Rules
  created: '2026-05-19'
  modified: '2026-05-19'
binds:
- namespace: env
  keys:
    THANOS_API_KEY: THANOS_API_KEY
capability:
  consumes:
  - type: http
    namespace: query-rules
    baseUri: http://localhost:9090
    description: Thanos Query API — Rules business capability. Self-contained, no shared references.
    resources:
    - name: api-v1-alerts
      path: /api/v1/alerts
      operations:
      - name: getalerts
        method: GET
        description: Get Active Alerts
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: api-v1-rules
      path: /api/v1/rules
      operations:
      - name: getrules
        method: GET
        description: Get Alerting and Recording Rules
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: type
          in: query
          type: string
          description: Filter by rule type
        - name: match[]
          in: query
          type: array
          description: Filter rules by label matchers
  exposes:
  - type: rest
    namespace: query-rules-rest
    port: 8080
    description: REST adapter for Thanos Query API — Rules. One Spectral-compliant resource per consumed operation, prefixed
      with /v1.
    resources:
    - path: /v1/api/v1/alerts
      name: api-v1-alerts
      description: REST surface for api-v1-alerts.
      operations:
      - method: GET
        name: getalerts
        description: Get Active Alerts
        call: query-rules.getalerts
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/api/v1/rules
      name: api-v1-rules
      description: REST surface for api-v1-rules.
      operations:
      - method: GET
        name: getrules
        description: Get Alerting and Recording Rules
        call: query-rules.getrules
        with:
          type: rest.type
          match[]: rest.match[]
        outputParameters:
        - type: object
          mapping: $.
  - type: mcp
    namespace: query-rules-mcp
    port: 9090
    transport: http
    description: MCP adapter for Thanos Query API — Rules. One tool per consumed operation, routed inline through this capability's
      consumes block.
    tools:
    - name: get-active-alerts
      description: Get Active Alerts
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: query-rules.getalerts
      outputParameters:
      - type: object
        mapping: $.
    - name: get-alerting-and-recording-rules
      description: Get Alerting and Recording Rules
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: query-rules.getrules
      with:
        type: tools.type
        match[]: tools.match[]
      outputParameters:
      - type: object
        mapping: $.