Apache CouchDB · Capability

Apache CouchDB HTTP API — Documents

Apache CouchDB HTTP API — Documents. 6 operations. Lead operation: Apache CouchDB Get All Documents. Self-contained Naftiko capability covering one Apache Couchdb business surface.

Run with Naftiko Apache CouchdbDocuments

What You Can Do

GET
Getalldocs — Apache CouchDB Get All Documents
/v1/{db}/all-docs
POST
Bulkgetdocs — Apache CouchDB Bulk Get Documents
/v1/{db}/all-docs
POST
Bulkdocs — Apache CouchDB Bulk Document Operations
/v1/{db}/bulk-docs
GET
Getdocument — Apache CouchDB Get Document
/v1/{db}/{docid}
PUT
Createorupdatedocument — Apache CouchDB Create or Update Document
/v1/{db}/{docid}
DELETE
Deletedocument — Apache CouchDB Delete Document
/v1/{db}/{docid}

MCP Tools

apache-couchdb-get-all-documents

Apache CouchDB Get All Documents

read-only idempotent
apache-couchdb-bulk-get-documents

Apache CouchDB Bulk Get Documents

read-only
apache-couchdb-bulk-document-operations

Apache CouchDB Bulk Document Operations

apache-couchdb-get-document

Apache CouchDB Get Document

read-only idempotent
apache-couchdb-create-update-document

Apache CouchDB Create or Update Document

idempotent
apache-couchdb-delete-document

Apache CouchDB Delete Document

idempotent

Capability Spec

http-documents.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: Apache CouchDB HTTP API — Documents
  description: 'Apache CouchDB HTTP API — Documents. 6 operations. Lead operation: Apache CouchDB Get All Documents. Self-contained
    Naftiko capability covering one Apache Couchdb business surface.'
  tags:
  - Apache Couchdb
  - Documents
  created: '2026-05-19'
  modified: '2026-05-19'
binds:
- namespace: env
  keys:
    APACHE_COUCHDB_API_KEY: APACHE_COUCHDB_API_KEY
capability:
  consumes:
  - type: http
    namespace: http-documents
    baseUri: http://localhost:5984
    description: Apache CouchDB HTTP API — Documents business capability. Self-contained, no shared references.
    resources:
    - name: db-_all_docs
      path: /{db}/_all_docs
      operations:
      - name: getalldocs
        method: GET
        description: Apache CouchDB Get All Documents
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: include_docs
          in: query
          type: boolean
          description: Include the document body for each row.
        - name: limit
          in: query
          type: integer
          description: Maximum number of rows to return.
        - name: skip
          in: query
          type: integer
          description: Number of rows to skip.
        - name: startkey
          in: query
          type: string
          description: Start key for filtering rows.
        - name: endkey
          in: query
          type: string
          description: End key for filtering rows.
        - name: descending
          in: query
          type: boolean
          description: Return rows in reverse order.
      - name: bulkgetdocs
        method: POST
        description: Apache CouchDB Bulk Get Documents
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: include_docs
          in: query
          type: boolean
          description: Include full document body.
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: true
    - name: db-_bulk_docs
      path: /{db}/_bulk_docs
      operations:
      - name: bulkdocs
        method: POST
        description: Apache CouchDB Bulk Document Operations
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: true
    - name: db-docid
      path: /{db}/{docid}
      operations:
      - name: getdocument
        method: GET
        description: Apache CouchDB Get Document
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: rev
          in: query
          type: string
          description: Specific revision ID to retrieve.
        - name: attachments
          in: query
          type: boolean
          description: Include attachment data inline (Base64 encoded).
      - name: createorupdatedocument
        method: PUT
        description: Apache CouchDB Create or Update Document
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: true
      - name: deletedocument
        method: DELETE
        description: Apache CouchDB Delete Document
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: rev
          in: query
          type: string
          description: Current revision of the document.
          required: true
    authentication:
      type: apikey
      key: AuthSession
      value: '{{env.APACHE_COUCHDB_API_KEY}}'
      placement: cookie
  exposes:
  - type: rest
    namespace: http-documents-rest
    port: 8080
    description: REST adapter for Apache CouchDB HTTP API — Documents. One Spectral-compliant resource per consumed operation,
      prefixed with /v1.
    resources:
    - path: /v1/{db}/all-docs
      name: db-all-docs
      description: REST surface for db-_all_docs.
      operations:
      - method: GET
        name: getalldocs
        description: Apache CouchDB Get All Documents
        call: http-documents.getalldocs
        with:
          include_docs: rest.include_docs
          limit: rest.limit
          skip: rest.skip
          startkey: rest.startkey
          endkey: rest.endkey
          descending: rest.descending
        outputParameters:
        - type: object
          mapping: $.
      - method: POST
        name: bulkgetdocs
        description: Apache CouchDB Bulk Get Documents
        call: http-documents.bulkgetdocs
        with:
          include_docs: rest.include_docs
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/{db}/bulk-docs
      name: db-bulk-docs
      description: REST surface for db-_bulk_docs.
      operations:
      - method: POST
        name: bulkdocs
        description: Apache CouchDB Bulk Document Operations
        call: http-documents.bulkdocs
        with:
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/{db}/{docid}
      name: db-docid
      description: REST surface for db-docid.
      operations:
      - method: GET
        name: getdocument
        description: Apache CouchDB Get Document
        call: http-documents.getdocument
        with:
          rev: rest.rev
          attachments: rest.attachments
        outputParameters:
        - type: object
          mapping: $.
      - method: PUT
        name: createorupdatedocument
        description: Apache CouchDB Create or Update Document
        call: http-documents.createorupdatedocument
        with:
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
      - method: DELETE
        name: deletedocument
        description: Apache CouchDB Delete Document
        call: http-documents.deletedocument
        with:
          rev: rest.rev
        outputParameters:
        - type: object
          mapping: $.
  - type: mcp
    namespace: http-documents-mcp
    port: 9090
    transport: http
    description: MCP adapter for Apache CouchDB HTTP API — Documents. One tool per consumed operation, routed inline through
      this capability's consumes block.
    tools:
    - name: apache-couchdb-get-all-documents
      description: Apache CouchDB Get All Documents
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: http-documents.getalldocs
      with:
        include_docs: tools.include_docs
        limit: tools.limit
        skip: tools.skip
        startkey: tools.startkey
        endkey: tools.endkey
        descending: tools.descending
      outputParameters:
      - type: object
        mapping: $.
    - name: apache-couchdb-bulk-get-documents
      description: Apache CouchDB Bulk Get Documents
      hints:
        readOnly: true
        destructive: false
        idempotent: false
      call: http-documents.bulkgetdocs
      with:
        include_docs: tools.include_docs
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: apache-couchdb-bulk-document-operations
      description: Apache CouchDB Bulk Document Operations
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: http-documents.bulkdocs
      with:
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: apache-couchdb-get-document
      description: Apache CouchDB Get Document
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: http-documents.getdocument
      with:
        rev: tools.rev
        attachments: tools.attachments
      outputParameters:
      - type: object
        mapping: $.
    - name: apache-couchdb-create-update-document
      description: Apache CouchDB Create or Update Document
      hints:
        readOnly: false
        destructive: false
        idempotent: true
      call: http-documents.createorupdatedocument
      with:
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: apache-couchdb-delete-document
      description: Apache CouchDB Delete Document
      hints:
        readOnly: false
        destructive: true
        idempotent: true
      call: http-documents.deletedocument
      with:
        rev: tools.rev
      outputParameters:
      - type: object
        mapping: $.