naftiko: 1.0.0-alpha2 info: label: Couchbase Sync Gateway Public REST API — Documents description: 'Couchbase Sync Gateway Public REST API — Documents. 6 operations. Lead operation: Get all documents. Self-contained Naftiko capability covering one Couchbase business surface.' tags: - Couchbase - Documents created: '2026-05-19' modified: '2026-05-19' binds: - namespace: env keys: COUCHBASE_API_KEY: COUCHBASE_API_KEY capability: consumes: - type: http namespace: sync-gateway-public-rest-documents baseUri: https://localhost:4984 description: Couchbase Sync Gateway Public REST API — Documents business capability. Self-contained, no shared references. resources: - name: db-_all_docs path: /{db}/_all_docs operations: - name: getalldocs method: GET description: Get all documents outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: include_docs in: query type: boolean description: Whether to include document bodies - name: channels in: query type: string description: Filter by channel name - name: startkey in: query type: string description: Start key for range - name: endkey in: query type: string description: End key for range - name: limit in: query type: integer description: Maximum number of results - name: db-_bulk_docs path: /{db}/_bulk_docs operations: - name: bulkdocs method: POST description: Create or update multiple documents outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: body in: body type: object description: Request body (JSON). required: true - name: db-_bulk_get path: /{db}/_bulk_get operations: - name: bulkget method: POST description: Get multiple documents outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: attachments in: query type: boolean description: Whether to include attachments - name: revs in: query type: boolean description: Whether to include revision history - name: body in: body type: object description: Request body (JSON). required: true - name: db-docId path: /{db}/{docId} operations: - name: getdocument method: GET description: Get a document outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: rev in: query type: string description: Specific revision ID to retrieve - name: revs in: query type: boolean description: Whether to include revision history - name: open_revs in: query type: string description: Retrieve all leaf revisions or specific revision IDs - name: attachments in: query type: boolean description: Whether to include inline attachment data - name: show_exp in: query type: boolean description: Whether to include document expiry information - name: putdocument method: PUT description: Create or update a document outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: rev in: query type: string description: Current revision ID for update operations - name: body in: body type: object description: Request body (JSON). required: true - name: deletedocument method: DELETE description: Delete a document outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: rev in: query type: string description: Current revision ID of the document required: true authentication: type: apikey key: SyncGatewaySession value: '{{env.COUCHBASE_API_KEY}}' placement: cookie exposes: - type: rest namespace: sync-gateway-public-rest-documents-rest port: 8080 description: REST adapter for Couchbase Sync Gateway Public REST 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: Get all documents call: sync-gateway-public-rest-documents.getalldocs with: include_docs: rest.include_docs channels: rest.channels startkey: rest.startkey endkey: rest.endkey limit: rest.limit 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: Create or update multiple documents call: sync-gateway-public-rest-documents.bulkdocs with: body: rest.body outputParameters: - type: object mapping: $. - path: /v1/{db}/bulk-get name: db-bulk-get description: REST surface for db-_bulk_get. operations: - method: POST name: bulkget description: Get multiple documents call: sync-gateway-public-rest-documents.bulkget with: attachments: rest.attachments revs: rest.revs 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: Get a document call: sync-gateway-public-rest-documents.getdocument with: rev: rest.rev revs: rest.revs open_revs: rest.open_revs attachments: rest.attachments show_exp: rest.show_exp outputParameters: - type: object mapping: $. - method: PUT name: putdocument description: Create or update a document call: sync-gateway-public-rest-documents.putdocument with: rev: rest.rev body: rest.body outputParameters: - type: object mapping: $. - method: DELETE name: deletedocument description: Delete a document call: sync-gateway-public-rest-documents.deletedocument with: rev: rest.rev outputParameters: - type: object mapping: $. - type: mcp namespace: sync-gateway-public-rest-documents-mcp port: 9090 transport: http description: MCP adapter for Couchbase Sync Gateway Public REST API — Documents. One tool per consumed operation, routed inline through this capability's consumes block. tools: - name: get-all-documents description: Get all documents hints: readOnly: true destructive: false idempotent: true call: sync-gateway-public-rest-documents.getalldocs with: include_docs: tools.include_docs channels: tools.channels startkey: tools.startkey endkey: tools.endkey limit: tools.limit outputParameters: - type: object mapping: $. - name: create-update-multiple-documents description: Create or update multiple documents hints: readOnly: false destructive: false idempotent: false call: sync-gateway-public-rest-documents.bulkdocs with: body: tools.body outputParameters: - type: object mapping: $. - name: get-multiple-documents description: Get multiple documents hints: readOnly: true destructive: false idempotent: false call: sync-gateway-public-rest-documents.bulkget with: attachments: tools.attachments revs: tools.revs body: tools.body outputParameters: - type: object mapping: $. - name: get-document description: Get a document hints: readOnly: true destructive: false idempotent: true call: sync-gateway-public-rest-documents.getdocument with: rev: tools.rev revs: tools.revs open_revs: tools.open_revs attachments: tools.attachments show_exp: tools.show_exp outputParameters: - type: object mapping: $. - name: create-update-document description: Create or update a document hints: readOnly: false destructive: false idempotent: true call: sync-gateway-public-rest-documents.putdocument with: rev: tools.rev body: tools.body outputParameters: - type: object mapping: $. - name: delete-document description: Delete a document hints: readOnly: false destructive: true idempotent: true call: sync-gateway-public-rest-documents.deletedocument with: rev: tools.rev outputParameters: - type: object mapping: $.