KVdb · Capability

KVdb API — Scripts

KVdb API — Scripts. 2 operations. Lead operation: Upload script. Self-contained Naftiko capability covering one Kvdb business surface.

Run with Naftiko KvdbScripts

What You Can Do

PUT
Uploadscript — Upload script
/v1/{bucket-id}/scripts/{script-name}
GET
Executescript — Execute script
/v1/{bucket-id}/scripts/{script-name}

MCP Tools

upload-script

Upload script

idempotent
execute-script

Execute script

read-only idempotent

Capability Spec

kvdb-scripts.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: KVdb API — Scripts
  description: 'KVdb API — Scripts. 2 operations. Lead operation: Upload script. Self-contained Naftiko capability covering
    one Kvdb business surface.'
  tags:
  - Kvdb
  - Scripts
  created: '2026-05-19'
  modified: '2026-05-19'
binds:
- namespace: env
  keys:
    KVDB_API_KEY: KVDB_API_KEY
capability:
  consumes:
  - type: http
    namespace: kvdb-scripts
    baseUri: https://kvdb.io
    description: KVdb API — Scripts business capability. Self-contained, no shared references.
    resources:
    - name: bucket_id-scripts-script_name
      path: /{bucket_id}/scripts/{script_name}
      operations:
      - name: uploadscript
        method: PUT
        description: Upload script
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: true
      - name: executescript
        method: GET
        description: Execute script
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    authentication:
      type: apikey
      key: secret_key
      value: '{{env.KVDB_API_KEY}}'
      placement: query
  exposes:
  - type: rest
    namespace: kvdb-scripts-rest
    port: 8080
    description: REST adapter for KVdb API — Scripts. One Spectral-compliant resource per consumed operation, prefixed with
      /v1.
    resources:
    - path: /v1/{bucket-id}/scripts/{script-name}
      name: bucket-id-scripts-script-name
      description: REST surface for bucket_id-scripts-script_name.
      operations:
      - method: PUT
        name: uploadscript
        description: Upload script
        call: kvdb-scripts.uploadscript
        with:
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
      - method: GET
        name: executescript
        description: Execute script
        call: kvdb-scripts.executescript
        outputParameters:
        - type: object
          mapping: $.
  - type: mcp
    namespace: kvdb-scripts-mcp
    port: 9090
    transport: http
    description: MCP adapter for KVdb API — Scripts. One tool per consumed operation, routed inline through this capability's
      consumes block.
    tools:
    - name: upload-script
      description: Upload script
      hints:
        readOnly: false
        destructive: false
        idempotent: true
      call: kvdb-scripts.uploadscript
      with:
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: execute-script
      description: Execute script
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: kvdb-scripts.executescript
      outputParameters:
      - type: object
        mapping: $.