Fake Store API · Capability

Fake Store API — Carts

Fake Store API — Carts. 7 operations. Lead operation: List carts. Self-contained Naftiko capability covering one Fake Store Api business surface.

Run with Naftiko Fake Store ApiCarts

What You Can Do

GET
Listcarts — List carts
/v1/carts
POST
Createcart — Create a cart
/v1/carts
GET
Listcartsbyuser — List carts for a user
/v1/carts/user/{userid}
GET
Getcart — Get a cart
/v1/carts/{id}
PUT
Replacecart — Replace a cart
/v1/carts/{id}
PATCH
Updatecart — Partially update a cart
/v1/carts/{id}
DELETE
Deletecart — Delete a cart
/v1/carts/{id}

MCP Tools

list-carts

List carts

read-only idempotent
create-cart

Create a cart

list-carts-user

List carts for a user

read-only idempotent
get-cart

Get a cart

read-only idempotent
replace-cart

Replace a cart

idempotent
partially-update-cart

Partially update a cart

idempotent
delete-cart

Delete a cart

idempotent

Capability Spec

fake-store-carts.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: Fake Store API — Carts
  description: 'Fake Store API — Carts. 7 operations. Lead operation: List carts. Self-contained Naftiko capability covering
    one Fake Store Api business surface.'
  tags:
  - Fake Store Api
  - Carts
  created: '2026-05-19'
  modified: '2026-05-19'
binds:
- namespace: env
  keys:
    FAKE_STORE_API_API_KEY: FAKE_STORE_API_API_KEY
capability:
  consumes:
  - type: http
    namespace: fake-store-carts
    baseUri: https://fakestoreapi.com
    description: Fake Store API — Carts business capability. Self-contained, no shared references.
    resources:
    - name: carts
      path: /carts
      operations:
      - name: listcarts
        method: GET
        description: List carts
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: startdate
          in: query
          type: string
          description: Start date for filtering carts
        - name: enddate
          in: query
          type: string
          description: End date for filtering carts
      - name: createcart
        method: POST
        description: Create a cart
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: true
    - name: carts-user-userId
      path: /carts/user/{userId}
      operations:
      - name: listcartsbyuser
        method: GET
        description: List carts for a user
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: carts-id
      path: /carts/{id}
      operations:
      - name: getcart
        method: GET
        description: Get a cart
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
      - name: replacecart
        method: PUT
        description: Replace a cart
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: true
      - name: updatecart
        method: PATCH
        description: Partially update a cart
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: true
      - name: deletecart
        method: DELETE
        description: Delete a cart
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
  exposes:
  - type: rest
    namespace: fake-store-carts-rest
    port: 8080
    description: REST adapter for Fake Store API — Carts. One Spectral-compliant resource per consumed operation, prefixed
      with /v1.
    resources:
    - path: /v1/carts
      name: carts
      description: REST surface for carts.
      operations:
      - method: GET
        name: listcarts
        description: List carts
        call: fake-store-carts.listcarts
        with:
          startdate: rest.startdate
          enddate: rest.enddate
        outputParameters:
        - type: object
          mapping: $.
      - method: POST
        name: createcart
        description: Create a cart
        call: fake-store-carts.createcart
        with:
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/carts/user/{userid}
      name: carts-user-userid
      description: REST surface for carts-user-userId.
      operations:
      - method: GET
        name: listcartsbyuser
        description: List carts for a user
        call: fake-store-carts.listcartsbyuser
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/carts/{id}
      name: carts-id
      description: REST surface for carts-id.
      operations:
      - method: GET
        name: getcart
        description: Get a cart
        call: fake-store-carts.getcart
        outputParameters:
        - type: object
          mapping: $.
      - method: PUT
        name: replacecart
        description: Replace a cart
        call: fake-store-carts.replacecart
        with:
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
      - method: PATCH
        name: updatecart
        description: Partially update a cart
        call: fake-store-carts.updatecart
        with:
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
      - method: DELETE
        name: deletecart
        description: Delete a cart
        call: fake-store-carts.deletecart
        outputParameters:
        - type: object
          mapping: $.
  - type: mcp
    namespace: fake-store-carts-mcp
    port: 9090
    transport: http
    description: MCP adapter for Fake Store API — Carts. One tool per consumed operation, routed inline through this capability's
      consumes block.
    tools:
    - name: list-carts
      description: List carts
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: fake-store-carts.listcarts
      with:
        startdate: tools.startdate
        enddate: tools.enddate
      outputParameters:
      - type: object
        mapping: $.
    - name: create-cart
      description: Create a cart
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: fake-store-carts.createcart
      with:
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: list-carts-user
      description: List carts for a user
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: fake-store-carts.listcartsbyuser
      outputParameters:
      - type: object
        mapping: $.
    - name: get-cart
      description: Get a cart
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: fake-store-carts.getcart
      outputParameters:
      - type: object
        mapping: $.
    - name: replace-cart
      description: Replace a cart
      hints:
        readOnly: false
        destructive: false
        idempotent: true
      call: fake-store-carts.replacecart
      with:
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: partially-update-cart
      description: Partially update a cart
      hints:
        readOnly: false
        destructive: false
        idempotent: true
      call: fake-store-carts.updatecart
      with:
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: delete-cart
      description: Delete a cart
      hints:
        readOnly: false
        destructive: true
        idempotent: true
      call: fake-store-carts.deletecart
      outputParameters:
      - type: object
        mapping: $.