Prometheus · Capability

Prometheus HTTP API — Query

Prometheus HTTP API — Query. 5 operations. Lead operation: Prometheus Execute instant query. Self-contained Naftiko capability covering one Prometheus business surface.

Run with Naftiko PrometheusQuery

What You Can Do

GET
Queryinstant — Prometheus Execute instant query
/v1/api/v1/query
POST
Queryinstantpost — Prometheus Execute instant query (POST)
/v1/api/v1/query
GET
Queryexemplars — Prometheus Query exemplars
/v1/api/v1/query-exemplars
GET
Queryrange — Prometheus Execute range query
/v1/api/v1/query-range
POST
Queryrangepost — Prometheus Execute range query (POST)
/v1/api/v1/query-range

MCP Tools

prometheus-execute-instant-query

Prometheus Execute instant query

read-only idempotent
prometheus-execute-instant-query-post

Prometheus Execute instant query (POST)

read-only
prometheus-query-exemplars

Prometheus Query exemplars

read-only idempotent
prometheus-execute-range-query

Prometheus Execute range query

read-only idempotent
prometheus-execute-range-query-post

Prometheus Execute range query (POST)

read-only

Capability Spec

http-query.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: Prometheus HTTP API — Query
  description: 'Prometheus HTTP API — Query. 5 operations. Lead operation: Prometheus Execute instant query. Self-contained
    Naftiko capability covering one Prometheus business surface.'
  tags:
  - Prometheus
  - Query
  created: '2026-05-19'
  modified: '2026-05-19'
binds:
- namespace: env
  keys:
    PROMETHEUS_API_KEY: PROMETHEUS_API_KEY
capability:
  consumes:
  - type: http
    namespace: http-query
    baseUri: http://{host}:{port}
    description: Prometheus HTTP API — Query business capability. Self-contained, no shared references.
    resources:
    - name: api-v1-query
      path: /api/v1/query
      operations:
      - name: queryinstant
        method: GET
        description: Prometheus Execute instant query
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: time
          in: query
          type: string
          description: Evaluation timestamp as a Unix timestamp or RFC3339 string. Defaults to current server time.
      - name: queryinstantpost
        method: POST
        description: Prometheus Execute instant query (POST)
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: true
    - name: api-v1-query_exemplars
      path: /api/v1/query_exemplars
      operations:
      - name: queryexemplars
        method: GET
        description: Prometheus Query exemplars
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: start
          in: query
          type: string
          description: Start of the time range.
          required: true
        - name: end
          in: query
          type: string
          description: End of the time range.
          required: true
    - name: api-v1-query_range
      path: /api/v1/query_range
      operations:
      - name: queryrange
        method: GET
        description: Prometheus Execute range query
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: start
          in: query
          type: string
          description: Start of the time range as a Unix timestamp or RFC3339 string.
          required: true
        - name: end
          in: query
          type: string
          description: End of the time range as a Unix timestamp or RFC3339 string.
          required: true
        - name: step
          in: query
          type: string
          description: Query resolution step width as a duration string (e.g., 15s, 1m, 1h).
          required: true
      - name: queryrangepost
        method: POST
        description: Prometheus Execute range query (POST)
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: true
  exposes:
  - type: rest
    namespace: http-query-rest
    port: 8080
    description: REST adapter for Prometheus HTTP API — Query. One Spectral-compliant resource per consumed operation, prefixed
      with /v1.
    resources:
    - path: /v1/api/v1/query
      name: api-v1-query
      description: REST surface for api-v1-query.
      operations:
      - method: GET
        name: queryinstant
        description: Prometheus Execute instant query
        call: http-query.queryinstant
        with:
          time: rest.time
        outputParameters:
        - type: object
          mapping: $.
      - method: POST
        name: queryinstantpost
        description: Prometheus Execute instant query (POST)
        call: http-query.queryinstantpost
        with:
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/api/v1/query-exemplars
      name: api-v1-query-exemplars
      description: REST surface for api-v1-query_exemplars.
      operations:
      - method: GET
        name: queryexemplars
        description: Prometheus Query exemplars
        call: http-query.queryexemplars
        with:
          start: rest.start
          end: rest.end
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/api/v1/query-range
      name: api-v1-query-range
      description: REST surface for api-v1-query_range.
      operations:
      - method: GET
        name: queryrange
        description: Prometheus Execute range query
        call: http-query.queryrange
        with:
          start: rest.start
          end: rest.end
          step: rest.step
        outputParameters:
        - type: object
          mapping: $.
      - method: POST
        name: queryrangepost
        description: Prometheus Execute range query (POST)
        call: http-query.queryrangepost
        with:
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
  - type: mcp
    namespace: http-query-mcp
    port: 9090
    transport: http
    description: MCP adapter for Prometheus HTTP API — Query. One tool per consumed operation, routed inline through this
      capability's consumes block.
    tools:
    - name: prometheus-execute-instant-query
      description: Prometheus Execute instant query
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: http-query.queryinstant
      with:
        time: tools.time
      outputParameters:
      - type: object
        mapping: $.
    - name: prometheus-execute-instant-query-post
      description: Prometheus Execute instant query (POST)
      hints:
        readOnly: true
        destructive: false
        idempotent: false
      call: http-query.queryinstantpost
      with:
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: prometheus-query-exemplars
      description: Prometheus Query exemplars
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: http-query.queryexemplars
      with:
        start: tools.start
        end: tools.end
      outputParameters:
      - type: object
        mapping: $.
    - name: prometheus-execute-range-query
      description: Prometheus Execute range query
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: http-query.queryrange
      with:
        start: tools.start
        end: tools.end
        step: tools.step
      outputParameters:
      - type: object
        mapping: $.
    - name: prometheus-execute-range-query-post
      description: Prometheus Execute range query (POST)
      hints:
        readOnly: true
        destructive: false
        idempotent: false
      call: http-query.queryrangepost
      with:
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.