fauna · Capability

Fauna Core HTTP API

The Fauna Core HTTP API provides direct access to the Fauna serverless document database through HTTPS endpoints. It allows developers to execute Fauna Query Language (FQL) queries, manage databases, perform CRUD operations on documents, manage schema as FSL files, and consume change data capture events via event feeds. The API uses token-based authentication and supports features such as transactions, indexes, and set operations. It serves as the foundation upon which Fauna's client drivers and SDKs are built.

Run with Naftiko FaunaAPI

What You Can Do

POST
Executequery — Execute an FQL query
/query/1
POST
Polleventfeed — Poll an event feed
/feed/1
GET
Getschemafiles — Get schema files
/schema/1/files
POST
Updateschemafiles — Update schema files
/schema/1/update
POST
Validateschemafiles — Validate schema files
/schema/1/validate
GET
Getstagedschemastatus — Get staged schema status
/schema/1/status
POST
Commitstagedschema — Commit staged schema
/schema/1/staged/commit
POST
Abandonstagedschema — Abandon staged schema
/schema/1/staged/abandon

MCP Tools

executequery

Execute an FQL query

polleventfeed

Poll an event feed

getschemafiles

Get schema files

read-only idempotent
updateschemafiles

Update schema files

validateschemafiles

Validate schema files

getstagedschemastatus

Get staged schema status

read-only idempotent
commitstagedschema

Commit staged schema

abandonstagedschema

Abandon staged schema

Capability Spec

fauna-capability.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: Fauna Core HTTP API
  description: The Fauna Core HTTP API provides direct access to the Fauna serverless document database through HTTPS endpoints.
    It allows developers to execute Fauna Query Language (FQL) queries, manage databases, perform CRUD operations on documents,
    manage schema as FSL files, and consume change data capture events via event feeds. The API uses token-based authentication
    and supports features such as transactions, indexes, and set operations. It serves as the foundation upon which Fauna's
    client drivers and SDKs are built.
  tags:
  - Fauna
  - API
  created: '2026-05-06'
  modified: '2026-05-06'
capability:
  consumes:
  - type: http
    namespace: fauna
    baseUri: https://db.fauna.com
    description: Fauna Core HTTP API HTTP API.
    authentication:
      type: bearer
      token: '{{FAUNA_TOKEN}}'
    resources:
    - name: query-1
      path: /query/1
      operations:
      - name: executequery
        method: POST
        description: Execute an FQL query
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: feed-1
      path: /feed/1
      operations:
      - name: polleventfeed
        method: POST
        description: Poll an event feed
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: schema-1-files
      path: /schema/1/files
      operations:
      - name: getschemafiles
        method: GET
        description: Get schema files
        inputParameters:
        - name: staged
          in: query
          type: boolean
          description: If true, return staged schema files instead of active schema files.
        - name: version
          in: query
          type: integer
          description: Schema version timestamp to retrieve a specific version of the schema files.
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: schema-1-update
      path: /schema/1/update
      operations:
      - name: updateschemafiles
        method: POST
        description: Update schema files
        inputParameters:
        - name: staged
          in: query
          type: boolean
          description: If true, stage the schema changes instead of applying immediately.
        - name: version
          in: query
          type: integer
          description: Expected schema version. The request fails if the version does not match the current schema version.
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: schema-1-validate
      path: /schema/1/validate
      operations:
      - name: validateschemafiles
        method: POST
        description: Validate schema files
        inputParameters:
        - name: staged
          in: query
          type: boolean
          description: If true, validate against staged schema instead of active schema.
        - name: version
          in: query
          type: integer
          description: Expected schema version for validation.
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: schema-1-status
      path: /schema/1/status
      operations:
      - name: getstagedschemastatus
        method: GET
        description: Get staged schema status
        inputParameters:
        - name: version
          in: query
          type: integer
          description: Expected schema version.
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: schema-1-staged-commit
      path: /schema/1/staged/commit
      operations:
      - name: commitstagedschema
        method: POST
        description: Commit staged schema
        inputParameters:
        - name: version
          in: query
          type: integer
          description: Expected schema version.
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: schema-1-staged-abandon
      path: /schema/1/staged/abandon
      operations:
      - name: abandonstagedschema
        method: POST
        description: Abandon staged schema
        inputParameters:
        - name: version
          in: query
          type: integer
          description: Expected schema version.
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
  exposes:
  - type: rest
    port: 8080
    namespace: fauna-rest
    description: REST adapter for Fauna Core HTTP API.
    resources:
    - path: /query/1
      name: executequery
      operations:
      - method: POST
        name: executequery
        description: Execute an FQL query
        call: fauna.executequery
        outputParameters:
        - type: object
          mapping: $.
    - path: /feed/1
      name: polleventfeed
      operations:
      - method: POST
        name: polleventfeed
        description: Poll an event feed
        call: fauna.polleventfeed
        outputParameters:
        - type: object
          mapping: $.
    - path: /schema/1/files
      name: getschemafiles
      operations:
      - method: GET
        name: getschemafiles
        description: Get schema files
        call: fauna.getschemafiles
        outputParameters:
        - type: object
          mapping: $.
    - path: /schema/1/update
      name: updateschemafiles
      operations:
      - method: POST
        name: updateschemafiles
        description: Update schema files
        call: fauna.updateschemafiles
        outputParameters:
        - type: object
          mapping: $.
    - path: /schema/1/validate
      name: validateschemafiles
      operations:
      - method: POST
        name: validateschemafiles
        description: Validate schema files
        call: fauna.validateschemafiles
        outputParameters:
        - type: object
          mapping: $.
    - path: /schema/1/status
      name: getstagedschemastatus
      operations:
      - method: GET
        name: getstagedschemastatus
        description: Get staged schema status
        call: fauna.getstagedschemastatus
        outputParameters:
        - type: object
          mapping: $.
    - path: /schema/1/staged/commit
      name: commitstagedschema
      operations:
      - method: POST
        name: commitstagedschema
        description: Commit staged schema
        call: fauna.commitstagedschema
        outputParameters:
        - type: object
          mapping: $.
    - path: /schema/1/staged/abandon
      name: abandonstagedschema
      operations:
      - method: POST
        name: abandonstagedschema
        description: Abandon staged schema
        call: fauna.abandonstagedschema
        outputParameters:
        - type: object
          mapping: $.
  - type: mcp
    port: 9090
    namespace: fauna-mcp
    transport: http
    description: MCP adapter for Fauna Core HTTP API for AI agent use.
    tools:
    - name: executequery
      description: Execute an FQL query
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: fauna.executequery
      outputParameters:
      - type: object
        mapping: $.
    - name: polleventfeed
      description: Poll an event feed
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: fauna.polleventfeed
      outputParameters:
      - type: object
        mapping: $.
    - name: getschemafiles
      description: Get schema files
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: fauna.getschemafiles
      with:
        staged: tools.staged
        version: tools.version
      inputParameters:
      - name: staged
        type: boolean
        description: If true, return staged schema files instead of active schema files.
      - name: version
        type: integer
        description: Schema version timestamp to retrieve a specific version of the schema files.
      outputParameters:
      - type: object
        mapping: $.
    - name: updateschemafiles
      description: Update schema files
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: fauna.updateschemafiles
      with:
        staged: tools.staged
        version: tools.version
      inputParameters:
      - name: staged
        type: boolean
        description: If true, stage the schema changes instead of applying immediately.
      - name: version
        type: integer
        description: Expected schema version. The request fails if the version does not match the current schema version.
      outputParameters:
      - type: object
        mapping: $.
    - name: validateschemafiles
      description: Validate schema files
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: fauna.validateschemafiles
      with:
        staged: tools.staged
        version: tools.version
      inputParameters:
      - name: staged
        type: boolean
        description: If true, validate against staged schema instead of active schema.
      - name: version
        type: integer
        description: Expected schema version for validation.
      outputParameters:
      - type: object
        mapping: $.
    - name: getstagedschemastatus
      description: Get staged schema status
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: fauna.getstagedschemastatus
      with:
        version: tools.version
      inputParameters:
      - name: version
        type: integer
        description: Expected schema version.
      outputParameters:
      - type: object
        mapping: $.
    - name: commitstagedschema
      description: Commit staged schema
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: fauna.commitstagedschema
      with:
        version: tools.version
      inputParameters:
      - name: version
        type: integer
        description: Expected schema version.
      outputParameters:
      - type: object
        mapping: $.
    - name: abandonstagedschema
      description: Abandon staged schema
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: fauna.abandonstagedschema
      with:
        version: tools.version
      inputParameters:
      - name: version
        type: integer
        description: Expected schema version.
      outputParameters:
      - type: object
        mapping: $.
binds:
- namespace: env
  keys:
    FAUNA_TOKEN: FAUNA_TOKEN