Apache Livy · Capability

Apache Livy REST API — Sessions

Apache Livy REST API — Sessions. 6 operations. Lead operation: Apache livy Apache Livy List Sessions. Self-contained Naftiko capability covering one Apache Livy business surface.

Run with Naftiko Apache LivySessions

What You Can Do

GET
Listsessions — Apache livy Apache Livy List Sessions
/v1/sessions
POST
Createsession — Apache livy Apache Livy Create Session
/v1/sessions
GET
Getsession — Apache livy Apache Livy Get Session
/v1/sessions/{sessionid}
DELETE
Deletesession — Apache livy Apache Livy Delete Session
/v1/sessions/{sessionid}
GET
Getsessionlog — Apache livy Apache Livy Get Session Log
/v1/sessions/{sessionid}/log
GET
Getsessionstate — Apache livy Apache Livy Get Session State
/v1/sessions/{sessionid}/state

MCP Tools

apache-livy-apache-livy-list

Apache livy Apache Livy List Sessions

read-only idempotent
apache-livy-apache-livy-create

Apache livy Apache Livy Create Session

apache-livy-apache-livy-get

Apache livy Apache Livy Get Session

read-only idempotent
apache-livy-apache-livy-delete

Apache livy Apache Livy Delete Session

idempotent
apache-livy-apache-livy-get-2

Apache livy Apache Livy Get Session Log

read-only idempotent
apache-livy-apache-livy-get-3

Apache livy Apache Livy Get Session State

read-only idempotent

Capability Spec

rest-sessions.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: Apache Livy REST API — Sessions
  description: 'Apache Livy REST API — Sessions. 6 operations. Lead operation: Apache livy Apache Livy List Sessions. Self-contained
    Naftiko capability covering one Apache Livy business surface.'
  tags:
  - Apache Livy
  - Sessions
  created: '2026-05-19'
  modified: '2026-05-19'
binds:
- namespace: env
  keys:
    APACHE_LIVY_API_KEY: APACHE_LIVY_API_KEY
capability:
  consumes:
  - type: http
    namespace: rest-sessions
    baseUri: http://localhost:8998
    description: Apache Livy REST API — Sessions business capability. Self-contained, no shared references.
    resources:
    - name: sessions
      path: /sessions
      operations:
      - name: listsessions
        method: GET
        description: Apache livy Apache Livy List Sessions
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: from
          in: query
          type: integer
          description: Session index to start from
        - name: size
          in: query
          type: integer
          description: Number of sessions to return
      - name: createsession
        method: POST
        description: Apache livy Apache Livy Create Session
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: true
    - name: sessions-sessionId
      path: /sessions/{sessionId}
      operations:
      - name: getsession
        method: GET
        description: Apache livy Apache Livy Get Session
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: sessionId
          in: path
          type: integer
          description: Session identifier
          required: true
      - name: deletesession
        method: DELETE
        description: Apache livy Apache Livy Delete Session
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: sessionId
          in: path
          type: integer
          description: Session identifier
          required: true
    - name: sessions-sessionId-log
      path: /sessions/{sessionId}/log
      operations:
      - name: getsessionlog
        method: GET
        description: Apache livy Apache Livy Get Session Log
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: sessionId
          in: path
          type: integer
          required: true
        - name: from
          in: query
          type: integer
          description: Log line index to start from
        - name: size
          in: query
          type: integer
          description: Number of log lines to return
    - name: sessions-sessionId-state
      path: /sessions/{sessionId}/state
      operations:
      - name: getsessionstate
        method: GET
        description: Apache livy Apache Livy Get Session State
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: sessionId
          in: path
          type: integer
          description: Session identifier
          required: true
  exposes:
  - type: rest
    namespace: rest-sessions-rest
    port: 8080
    description: REST adapter for Apache Livy REST API — Sessions. One Spectral-compliant resource per consumed operation,
      prefixed with /v1.
    resources:
    - path: /v1/sessions
      name: sessions
      description: REST surface for sessions.
      operations:
      - method: GET
        name: listsessions
        description: Apache livy Apache Livy List Sessions
        call: rest-sessions.listsessions
        with:
          from: rest.from
          size: rest.size
        outputParameters:
        - type: object
          mapping: $.
      - method: POST
        name: createsession
        description: Apache livy Apache Livy Create Session
        call: rest-sessions.createsession
        with:
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/sessions/{sessionid}
      name: sessions-sessionid
      description: REST surface for sessions-sessionId.
      operations:
      - method: GET
        name: getsession
        description: Apache livy Apache Livy Get Session
        call: rest-sessions.getsession
        with:
          sessionId: rest.sessionId
        outputParameters:
        - type: object
          mapping: $.
      - method: DELETE
        name: deletesession
        description: Apache livy Apache Livy Delete Session
        call: rest-sessions.deletesession
        with:
          sessionId: rest.sessionId
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/sessions/{sessionid}/log
      name: sessions-sessionid-log
      description: REST surface for sessions-sessionId-log.
      operations:
      - method: GET
        name: getsessionlog
        description: Apache livy Apache Livy Get Session Log
        call: rest-sessions.getsessionlog
        with:
          sessionId: rest.sessionId
          from: rest.from
          size: rest.size
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/sessions/{sessionid}/state
      name: sessions-sessionid-state
      description: REST surface for sessions-sessionId-state.
      operations:
      - method: GET
        name: getsessionstate
        description: Apache livy Apache Livy Get Session State
        call: rest-sessions.getsessionstate
        with:
          sessionId: rest.sessionId
        outputParameters:
        - type: object
          mapping: $.
  - type: mcp
    namespace: rest-sessions-mcp
    port: 9090
    transport: http
    description: MCP adapter for Apache Livy REST API — Sessions. One tool per consumed operation, routed inline through this
      capability's consumes block.
    tools:
    - name: apache-livy-apache-livy-list
      description: Apache livy Apache Livy List Sessions
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: rest-sessions.listsessions
      with:
        from: tools.from
        size: tools.size
      outputParameters:
      - type: object
        mapping: $.
    - name: apache-livy-apache-livy-create
      description: Apache livy Apache Livy Create Session
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: rest-sessions.createsession
      with:
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: apache-livy-apache-livy-get
      description: Apache livy Apache Livy Get Session
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: rest-sessions.getsession
      with:
        sessionId: tools.sessionId
      outputParameters:
      - type: object
        mapping: $.
    - name: apache-livy-apache-livy-delete
      description: Apache livy Apache Livy Delete Session
      hints:
        readOnly: false
        destructive: true
        idempotent: true
      call: rest-sessions.deletesession
      with:
        sessionId: tools.sessionId
      outputParameters:
      - type: object
        mapping: $.
    - name: apache-livy-apache-livy-get-2
      description: Apache livy Apache Livy Get Session Log
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: rest-sessions.getsessionlog
      with:
        sessionId: tools.sessionId
        from: tools.from
        size: tools.size
      outputParameters:
      - type: object
        mapping: $.
    - name: apache-livy-apache-livy-get-3
      description: Apache livy Apache Livy Get Session State
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: rest-sessions.getsessionstate
      with:
        sessionId: tools.sessionId
      outputParameters:
      - type: object
        mapping: $.