Elastic · Capability

Elasticsearch REST API — Indices

Elasticsearch REST API — Indices. 2 operations. Lead operation: Create an index. Self-contained Naftiko capability covering one Elastic business surface.

Run with Naftiko ElasticIndices

What You Can Do

PUT
Createindex — Create an index
/v1/{index}
DELETE
Deleteindex — Delete an index
/v1/{index}

MCP Tools

create-index

Create an index

idempotent
delete-index

Delete an index

idempotent

Capability Spec

elasticsearch-indices.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: Elasticsearch REST API — Indices
  description: 'Elasticsearch REST API — Indices. 2 operations. Lead operation: Create an index. Self-contained Naftiko capability
    covering one Elastic business surface.'
  tags:
  - Elastic
  - Indices
  created: '2026-05-19'
  modified: '2026-05-19'
binds:
- namespace: env
  keys:
    ELASTIC_API_KEY: ELASTIC_API_KEY
capability:
  consumes:
  - type: http
    namespace: elasticsearch-indices
    baseUri: https://{deployment}.es.{region}.cloud.es.io:9243
    description: Elasticsearch REST API — Indices business capability. Self-contained, no shared references.
    resources:
    - name: index
      path: /{index}
      operations:
      - name: createindex
        method: PUT
        description: Create an index
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: index
          in: path
          type: string
          required: true
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: false
      - name: deleteindex
        method: DELETE
        description: Delete an index
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: index
          in: path
          type: string
          required: true
    authentication:
      type: apikey
      key: Authorization
      value: '{{env.ELASTIC_API_KEY}}'
      placement: header
  exposes:
  - type: rest
    namespace: elasticsearch-indices-rest
    port: 8080
    description: REST adapter for Elasticsearch REST API — Indices. One Spectral-compliant resource per consumed operation,
      prefixed with /v1.
    resources:
    - path: /v1/{index}
      name: index
      description: REST surface for index.
      operations:
      - method: PUT
        name: createindex
        description: Create an index
        call: elasticsearch-indices.createindex
        with:
          index: rest.index
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
      - method: DELETE
        name: deleteindex
        description: Delete an index
        call: elasticsearch-indices.deleteindex
        with:
          index: rest.index
        outputParameters:
        - type: object
          mapping: $.
  - type: mcp
    namespace: elasticsearch-indices-mcp
    port: 9090
    transport: http
    description: MCP adapter for Elasticsearch REST API — Indices. One tool per consumed operation, routed inline through
      this capability's consumes block.
    tools:
    - name: create-index
      description: Create an index
      hints:
        readOnly: false
        destructive: false
        idempotent: true
      call: elasticsearch-indices.createindex
      with:
        index: tools.index
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: delete-index
      description: Delete an index
      hints:
        readOnly: false
        destructive: true
        idempotent: true
      call: elasticsearch-indices.deleteindex
      with:
        index: tools.index
      outputParameters:
      - type: object
        mapping: $.