Azure Cosmos DB REST API — Documents

Azure Cosmos DB REST API — Documents. 5 operations. Lead operation: Cosmos DB List documents. Self-contained Naftiko capability covering one Microsoft Azure Cosmos Db business surface.

Run with Naftiko Microsoft Azure Cosmos DbDocuments

What You Can Do

GET
Listdocuments — Cosmos DB List documents
/v1/dbs/{databaseid}/colls/{collectionid}/docs
POST
Createdocument — Cosmos DB Create document
/v1/dbs/{databaseid}/colls/{collectionid}/docs
GET
Getdocument — Cosmos DB Get document
/v1/dbs/{databaseid}/colls/{collectionid}/docs/{documentid}
PUT
Replacedocument — Cosmos DB Replace document
/v1/dbs/{databaseid}/colls/{collectionid}/docs/{documentid}
DELETE
Deletedocument — Cosmos DB Delete document
/v1/dbs/{databaseid}/colls/{collectionid}/docs/{documentid}

MCP Tools

cosmos-db-list-documents

Cosmos DB List documents

read-only idempotent
cosmos-db-create-document

Cosmos DB Create document

cosmos-db-get-document

Cosmos DB Get document

read-only idempotent
cosmos-db-replace-document

Cosmos DB Replace document

idempotent
cosmos-db-delete-document

Cosmos DB Delete document

idempotent

Capability Spec

microsoft-azure-cosmos-db-documents.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: Azure Cosmos DB REST API — Documents
  description: 'Azure Cosmos DB REST API — Documents. 5 operations. Lead operation: Cosmos DB List documents. Self-contained
    Naftiko capability covering one Microsoft Azure Cosmos Db business surface.'
  tags:
  - Microsoft Azure Cosmos Db
  - Documents
  created: '2026-05-19'
  modified: '2026-05-19'
binds:
- namespace: env
  keys:
    MICROSOFT_AZURE_COSMOS_DB_API_KEY: MICROSOFT_AZURE_COSMOS_DB_API_KEY
capability:
  consumes:
  - type: http
    namespace: microsoft-azure-cosmos-db-documents
    baseUri: https://{account}.documents.azure.com
    description: Azure Cosmos DB REST API — Documents business capability. Self-contained, no shared references.
    resources:
    - name: dbs-databaseId-colls-collectionId-docs
      path: /dbs/{databaseId}/colls/{collectionId}/docs
      operations:
      - name: listdocuments
        method: GET
        description: Cosmos DB List documents
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
      - name: createdocument
        method: POST
        description: Cosmos DB Create document
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: true
    - name: dbs-databaseId-colls-collectionId-docs-documentId
      path: /dbs/{databaseId}/colls/{collectionId}/docs/{documentId}
      operations:
      - name: getdocument
        method: GET
        description: Cosmos DB Get document
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
      - name: replacedocument
        method: PUT
        description: Cosmos DB Replace 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: Cosmos DB Delete document
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    authentication:
      type: apikey
      key: Authorization
      value: '{{env.MICROSOFT_AZURE_COSMOS_DB_API_KEY}}'
      placement: header
  exposes:
  - type: rest
    namespace: microsoft-azure-cosmos-db-documents-rest
    port: 8080
    description: REST adapter for Azure Cosmos DB REST API — Documents. One Spectral-compliant resource per consumed operation,
      prefixed with /v1.
    resources:
    - path: /v1/dbs/{databaseid}/colls/{collectionid}/docs
      name: dbs-databaseid-colls-collectionid-docs
      description: REST surface for dbs-databaseId-colls-collectionId-docs.
      operations:
      - method: GET
        name: listdocuments
        description: Cosmos DB List documents
        call: microsoft-azure-cosmos-db-documents.listdocuments
        outputParameters:
        - type: object
          mapping: $.
      - method: POST
        name: createdocument
        description: Cosmos DB Create document
        call: microsoft-azure-cosmos-db-documents.createdocument
        with:
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/dbs/{databaseid}/colls/{collectionid}/docs/{documentid}
      name: dbs-databaseid-colls-collectionid-docs-documentid
      description: REST surface for dbs-databaseId-colls-collectionId-docs-documentId.
      operations:
      - method: GET
        name: getdocument
        description: Cosmos DB Get document
        call: microsoft-azure-cosmos-db-documents.getdocument
        outputParameters:
        - type: object
          mapping: $.
      - method: PUT
        name: replacedocument
        description: Cosmos DB Replace document
        call: microsoft-azure-cosmos-db-documents.replacedocument
        with:
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
      - method: DELETE
        name: deletedocument
        description: Cosmos DB Delete document
        call: microsoft-azure-cosmos-db-documents.deletedocument
        outputParameters:
        - type: object
          mapping: $.
  - type: mcp
    namespace: microsoft-azure-cosmos-db-documents-mcp
    port: 9090
    transport: http
    description: MCP adapter for Azure Cosmos DB REST API — Documents. One tool per consumed operation, routed inline through
      this capability's consumes block.
    tools:
    - name: cosmos-db-list-documents
      description: Cosmos DB List documents
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: microsoft-azure-cosmos-db-documents.listdocuments
      outputParameters:
      - type: object
        mapping: $.
    - name: cosmos-db-create-document
      description: Cosmos DB Create document
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: microsoft-azure-cosmos-db-documents.createdocument
      with:
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: cosmos-db-get-document
      description: Cosmos DB Get document
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: microsoft-azure-cosmos-db-documents.getdocument
      outputParameters:
      - type: object
        mapping: $.
    - name: cosmos-db-replace-document
      description: Cosmos DB Replace document
      hints:
        readOnly: false
        destructive: false
        idempotent: true
      call: microsoft-azure-cosmos-db-documents.replacedocument
      with:
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: cosmos-db-delete-document
      description: Cosmos DB Delete document
      hints:
        readOnly: false
        destructive: true
        idempotent: true
      call: microsoft-azure-cosmos-db-documents.deletedocument
      outputParameters:
      - type: object
        mapping: $.