Sanity · Capability

Sanity HTTP API — Listen

Sanity HTTP API — Listen. 1 operations. Lead operation: Listen for Changes. Self-contained Naftiko capability covering one Sanity business surface.

Run with Naftiko SanityListen

What You Can Do

GET
Listenforchanges — Listen for Changes
/v1/data/listen/{dataset}

MCP Tools

listen-changes

Listen for Changes

read-only idempotent

Capability Spec

sanity-listen.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: Sanity HTTP API — Listen
  description: 'Sanity HTTP API — Listen. 1 operations. Lead operation: Listen for Changes. Self-contained Naftiko capability
    covering one Sanity business surface.'
  tags:
  - Sanity
  - Listen
  created: '2026-05-19'
  modified: '2026-05-19'
binds:
- namespace: env
  keys:
    SANITY_API_KEY: SANITY_API_KEY
capability:
  consumes:
  - type: http
    namespace: sanity-listen
    baseUri: https://{projectId}.api.sanity.io/v{apiVersion}
    description: Sanity HTTP API — Listen business capability. Self-contained, no shared references.
    resources:
    - name: data-listen-dataset
      path: /data/listen/{dataset}
      operations:
      - name: listenforchanges
        method: GET
        description: Listen for Changes
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: dataset
          in: path
          type: string
          required: true
        - name: query
          in: query
          type: string
          description: GROQ query defining which documents to listen to
          required: true
        - name: includeResult
          in: query
          type: boolean
          description: Include full document in change events
        - name: visibility
          in: query
          type: string
    authentication:
      type: bearer
      token: '{{env.SANITY_API_KEY}}'
  exposes:
  - type: rest
    namespace: sanity-listen-rest
    port: 8080
    description: REST adapter for Sanity HTTP API — Listen. One Spectral-compliant resource per consumed operation, prefixed
      with /v1.
    resources:
    - path: /v1/data/listen/{dataset}
      name: data-listen-dataset
      description: REST surface for data-listen-dataset.
      operations:
      - method: GET
        name: listenforchanges
        description: Listen for Changes
        call: sanity-listen.listenforchanges
        with:
          dataset: rest.dataset
          query: rest.query
          includeResult: rest.includeResult
          visibility: rest.visibility
        outputParameters:
        - type: object
          mapping: $.
  - type: mcp
    namespace: sanity-listen-mcp
    port: 9090
    transport: http
    description: MCP adapter for Sanity HTTP API — Listen. One tool per consumed operation, routed inline through this capability's
      consumes block.
    tools:
    - name: listen-changes
      description: Listen for Changes
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: sanity-listen.listenforchanges
      with:
        dataset: tools.dataset
        query: tools.query
        includeResult: tools.includeResult
        visibility: tools.visibility
      outputParameters:
      - type: object
        mapping: $.