SWAPI - Star Wars API · Capability

SWAPI — Vehicles

SWAPI Vehicles. 2 operations (list + get). Lead operation: List All Vehicles. Non-hyperdrive vehicles from the Star Wars universe. Self-contained Naftiko capability covering one SWAPI business surface.

Run with Naftiko SWAPIStar WarsVehicles

What You Can Do

GET
Listvehicles — List All Vehicles
/v1/vehicles
GET
Getvehicle — Get Vehicle By Id
/v1/vehicles/{id}

MCP Tools

list-vehicles

List All Vehicles

read-only idempotent
get-vehicle

Get Vehicle By Id

read-only idempotent

Capability Spec

swapi-vehicles.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: SWAPI — Vehicles
  description: >-
    SWAPI Vehicles. 2 operations (list + get). Lead operation: List All Vehicles.
    Non-hyperdrive vehicles from the Star Wars universe.
    Self-contained Naftiko capability covering one SWAPI business surface.
  tags:
    - SWAPI
    - Star Wars
    - Vehicles
  created: '2026-05-29'
  modified: '2026-05-29'
binds:
  - namespace: env
    keys: {}
capability:
  consumes:
    - type: http
      namespace: swapi-vehicles
      baseUri: https://swapi.dev/api
      description: SWAPI — Vehicles business capability. Self-contained, no shared references.
      resources:
        - name: vehicles
          path: /vehicles/
          operations:
            - name: listVehicles
              method: GET
              description: List All Vehicles
              inputParameters:
                - name: search
                  in: query
                  type: string
                  required: false
                  description: Case-insensitive partial match against the vehicle name/model.
                - name: page
                  in: query
                  type: integer
                  required: false
                  description: One-based page number for paginated list responses.
              outputRawFormat: json
              outputParameters:
                - name: result
                  type: object
                  value: $.
            - name: getVehicle
              method: GET
              description: Get Vehicle By Id
              inputParameters:
                - name: id
                  in: path
                  type: integer
                  required: true
                  description: Numeric SWAPI identifier for the vehicle.
              outputRawFormat: json
              outputParameters:
                - name: result
                  type: object
                  value: $.
  exposes:
    - type: rest
      namespace: swapi-vehicles-rest
      port: 8080
      description: REST adapter for SWAPI — Vehicles. One Spectral-compliant resource per consumed operation, prefixed with /v1.
      resources:
        - path: /v1/vehicles
          name: vehicles
          description: REST surface for Vehicles.
          operations:
            - method: GET
              name: listVehicles
              description: List All Vehicles
              call: swapi-vehicles.listVehicles
              with:
                search: rest.search
                page: rest.page
              outputParameters:
                - type: object
                  mapping: $.
        - path: /v1/vehicles/{id}
          name: vehicles-by-id
          description: REST surface for a single Vehicle.
          operations:
            - method: GET
              name: getVehicle
              description: Get Vehicle By Id
              call: swapi-vehicles.getVehicle
              with:
                id: rest.id
              outputParameters:
                - type: object
                  mapping: $.
    - type: mcp
      namespace: swapi-vehicles-mcp
      port: 9090
      transport: http
      description: MCP adapter for SWAPI — Vehicles. One tool per consumed operation, routed inline through this capability's consumes block.
      tools:
        - name: list-vehicles
          description: List All Vehicles
          hints:
            readOnly: true
            destructive: false
            idempotent: true
          call: swapi-vehicles.listVehicles
          with:
            search: tools.search
            page: tools.page
          outputParameters:
            - type: object
              mapping: $.
        - name: get-vehicle
          description: Get Vehicle By Id
          hints:
            readOnly: true
            destructive: false
            idempotent: true
          call: swapi-vehicles.getVehicle
          with:
            id: tools.id
          outputParameters:
            - type: object
              mapping: $.