Prometheus · Capability

Prometheus HTTP API — Targets

Prometheus HTTP API — Targets. 2 operations. Lead operation: Prometheus Get scrape targets. Self-contained Naftiko capability covering one Prometheus business surface.

Run with Naftiko PrometheusTargets

What You Can Do

GET
Gettargets — Prometheus Get scrape targets
/v1/api/v1/targets
GET
Gettargetmetadata — Prometheus Get target metadata
/v1/api/v1/targets/metadata

MCP Tools

prometheus-get-scrape-targets

Prometheus Get scrape targets

read-only idempotent
prometheus-get-target-metadata

Prometheus Get target metadata

read-only idempotent

Capability Spec

http-targets.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: Prometheus HTTP API — Targets
  description: 'Prometheus HTTP API — Targets. 2 operations. Lead operation: Prometheus Get scrape targets. Self-contained
    Naftiko capability covering one Prometheus business surface.'
  tags:
  - Prometheus
  - Targets
  created: '2026-05-19'
  modified: '2026-05-19'
binds:
- namespace: env
  keys:
    PROMETHEUS_API_KEY: PROMETHEUS_API_KEY
capability:
  consumes:
  - type: http
    namespace: http-targets
    baseUri: http://{host}:{port}
    description: Prometheus HTTP API — Targets business capability. Self-contained, no shared references.
    resources:
    - name: api-v1-targets
      path: /api/v1/targets
      operations:
      - name: gettargets
        method: GET
        description: Prometheus Get scrape targets
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: state
          in: query
          type: string
          description: Filter targets by state.
    - name: api-v1-targets-metadata
      path: /api/v1/targets/metadata
      operations:
      - name: gettargetmetadata
        method: GET
        description: Prometheus Get target metadata
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: match_target
          in: query
          type: string
          description: Label selectors matching target labels.
        - name: metric
          in: query
          type: string
          description: Metric name to filter by.
  exposes:
  - type: rest
    namespace: http-targets-rest
    port: 8080
    description: REST adapter for Prometheus HTTP API — Targets. One Spectral-compliant resource per consumed operation, prefixed
      with /v1.
    resources:
    - path: /v1/api/v1/targets
      name: api-v1-targets
      description: REST surface for api-v1-targets.
      operations:
      - method: GET
        name: gettargets
        description: Prometheus Get scrape targets
        call: http-targets.gettargets
        with:
          state: rest.state
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/api/v1/targets/metadata
      name: api-v1-targets-metadata
      description: REST surface for api-v1-targets-metadata.
      operations:
      - method: GET
        name: gettargetmetadata
        description: Prometheus Get target metadata
        call: http-targets.gettargetmetadata
        with:
          match_target: rest.match_target
          metric: rest.metric
        outputParameters:
        - type: object
          mapping: $.
  - type: mcp
    namespace: http-targets-mcp
    port: 9090
    transport: http
    description: MCP adapter for Prometheus HTTP API — Targets. One tool per consumed operation, routed inline through this
      capability's consumes block.
    tools:
    - name: prometheus-get-scrape-targets
      description: Prometheus Get scrape targets
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: http-targets.gettargets
      with:
        state: tools.state
      outputParameters:
      - type: object
        mapping: $.
    - name: prometheus-get-target-metadata
      description: Prometheus Get target metadata
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: http-targets.gettargetmetadata
      with:
        match_target: tools.match_target
        metric: tools.metric
      outputParameters:
      - type: object
        mapping: $.