OpenUV · Capability

OpenUV API — Protection

Protection — sun protection window recommendations. 1 operation. Lead operation: Get Sun Protection Window. Self-contained Naftiko capability returning the start/end times when UV crosses the configurable from/to thresholds for any coordinate.

Run with Naftiko OpenUVWeatherProtection

What You Can Do

GET
Getprotectionwindow — Get the daily UV protection window for a coordinate.
/v1/protection-windows

MCP Tools

get-protection-window

Get start and end times of the daily UV protection window for a coordinate.

read-only idempotent

Capability Spec

openuv-protection.yaml Raw ↑
naftiko: "1.0.0-alpha2"

info:
  label: "OpenUV API — Protection"
  description: >-
    Protection — sun protection window recommendations. 1 operation. Lead
    operation: Get Sun Protection Window. Self-contained Naftiko capability
    returning the start/end times when UV crosses the configurable from/to
    thresholds for any coordinate.
  tags:
    - OpenUV
    - Weather
    - Protection
  created: "2026-05-29"
  modified: "2026-05-29"

binds:
  - namespace: env
    keys:
      OPENUV_API_KEY: OPENUV_API_KEY

capability:

  consumes:
    - type: http
      namespace: "openuv-protection"
      baseUri: "https://api.openuv.io/api/v1"
      description: "OpenUV API — Protection business capability. Self-contained, no shared references."
      authentication:
        type: apikey
        key: x-access-token
        value: "{{env.OPENUV_API_KEY}}"
        placement: header
      resources:
        - name: "protection"
          path: "/protection"
          operations:
            - name: "getProtectionWindow"
              method: GET
              description: "Get start and end times of the daily UV protection window for a coordinate."
              inputParameters:
                - name: "lat"
                  in: query
                  type: number
                  required: true
                  description: "Latitude in decimal degrees."
                - name: "lng"
                  in: query
                  type: number
                  required: true
                  description: "Longitude in decimal degrees."
                - name: "alt"
                  in: query
                  type: number
                  required: false
                  description: "Altitude in meters above sea level."
                - name: "from"
                  in: query
                  type: number
                  required: false
                  description: "Lower UV index bound for the protection window. Defaults to 3.5."
                - name: "to"
                  in: query
                  type: number
                  required: false
                  description: "Upper UV index bound for the protection window. Defaults to 3.5."
              outputRawFormat: json
              outputParameters:
                - name: result
                  type: object
                  value: "$."

  exposes:
    - type: rest
      namespace: "openuv-protection-rest"
      port: 8080
      description: "REST adapter for OpenUV API — Protection. One Spectral-compliant resource per consumed operation, prefixed with /v1."
      resources:
        - path: "/v1/protection-windows"
          name: "protection-windows"
          description: "REST surface for daily sun-protection windows."
          operations:
            - method: GET
              name: "getProtectionWindow"
              description: "Get the daily UV protection window for a coordinate."
              call: "openuv-protection.getProtectionWindow"
              with:
                lat: "rest.lat"
                lng: "rest.lng"
                alt: "rest.alt"
                from: "rest.from"
                to: "rest.to"
              outputParameters:
                - type: object
                  mapping: "$."

    - type: mcp
      namespace: "openuv-protection-mcp"
      port: 9090
      transport: http
      description: "MCP adapter for OpenUV API — Protection. One tool per consumed operation, routed inline through this capability's consumes block."
      tools:
        - name: "get-protection-window"
          description: "Get start and end times of the daily UV protection window for a coordinate."
          hints:
            readOnly: true
            destructive: false
            idempotent: true
          call: "openuv-protection.getProtectionWindow"
          with:
            lat: "tools.lat"
            lng: "tools.lng"
            alt: "tools.alt"
            from: "tools.from"
            to: "tools.to"
          outputParameters:
            - type: object
              mapping: "$."