Sanity · Capability

Sanity HTTP API — Projects

Sanity HTTP API — Projects. 8 operations. Lead operation: List Projects. Self-contained Naftiko capability covering one Sanity business surface.

Run with Naftiko SanityProjects

What You Can Do

GET
Listprojects — List Projects
/v1/projects
POST
Createproject — Create Project
/v1/projects
GET
Getproject — Get Project
/v1/projects/{projectid}
PATCH
Updateproject — Update Project
/v1/projects/{projectid}
GET
Listdatasets — List Datasets
/v1/projects/{projectid}/datasets
PUT
Createdataset — Create Dataset
/v1/projects/{projectid}/datasets
GET
Listtokens — List Tokens
/v1/projects/{projectid}/tokens
POST
Createtoken — Create Token
/v1/projects/{projectid}/tokens

MCP Tools

list-projects

List Projects

read-only idempotent
create-project

Create Project

get-project

Get Project

read-only idempotent
update-project

Update Project

idempotent
list-datasets

List Datasets

read-only idempotent
create-dataset

Create Dataset

idempotent
list-tokens

List Tokens

read-only idempotent
create-token

Create Token

Capability Spec

sanity-projects.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: Sanity HTTP API — Projects
  description: 'Sanity HTTP API — Projects. 8 operations. Lead operation: List Projects. Self-contained Naftiko capability
    covering one Sanity business surface.'
  tags:
  - Sanity
  - Projects
  created: '2026-05-19'
  modified: '2026-05-19'
binds:
- namespace: env
  keys:
    SANITY_API_KEY: SANITY_API_KEY
capability:
  consumes:
  - type: http
    namespace: sanity-projects
    baseUri: https://{projectId}.api.sanity.io/v{apiVersion}
    description: Sanity HTTP API — Projects business capability. Self-contained, no shared references.
    resources:
    - name: projects
      path: /projects
      operations:
      - name: listprojects
        method: GET
        description: List Projects
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
      - name: createproject
        method: POST
        description: Create Project
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: true
    - name: projects-projectId
      path: /projects/{projectId}
      operations:
      - name: getproject
        method: GET
        description: Get Project
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: projectId
          in: path
          type: string
          required: true
      - name: updateproject
        method: PATCH
        description: Update Project
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: projectId
          in: path
          type: string
          required: true
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: true
    - name: projects-projectId-datasets
      path: /projects/{projectId}/datasets
      operations:
      - name: listdatasets
        method: GET
        description: List Datasets
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: projectId
          in: path
          type: string
          required: true
      - name: createdataset
        method: PUT
        description: Create Dataset
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: projectId
          in: path
          type: string
          required: true
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: true
    - name: projects-projectId-tokens
      path: /projects/{projectId}/tokens
      operations:
      - name: listtokens
        method: GET
        description: List Tokens
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: projectId
          in: path
          type: string
          required: true
      - name: createtoken
        method: POST
        description: Create Token
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: projectId
          in: path
          type: string
          required: true
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: true
    authentication:
      type: bearer
      token: '{{env.SANITY_API_KEY}}'
  exposes:
  - type: rest
    namespace: sanity-projects-rest
    port: 8080
    description: REST adapter for Sanity HTTP API — Projects. One Spectral-compliant resource per consumed operation, prefixed
      with /v1.
    resources:
    - path: /v1/projects
      name: projects
      description: REST surface for projects.
      operations:
      - method: GET
        name: listprojects
        description: List Projects
        call: sanity-projects.listprojects
        outputParameters:
        - type: object
          mapping: $.
      - method: POST
        name: createproject
        description: Create Project
        call: sanity-projects.createproject
        with:
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/projects/{projectid}
      name: projects-projectid
      description: REST surface for projects-projectId.
      operations:
      - method: GET
        name: getproject
        description: Get Project
        call: sanity-projects.getproject
        with:
          projectId: rest.projectId
        outputParameters:
        - type: object
          mapping: $.
      - method: PATCH
        name: updateproject
        description: Update Project
        call: sanity-projects.updateproject
        with:
          projectId: rest.projectId
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/projects/{projectid}/datasets
      name: projects-projectid-datasets
      description: REST surface for projects-projectId-datasets.
      operations:
      - method: GET
        name: listdatasets
        description: List Datasets
        call: sanity-projects.listdatasets
        with:
          projectId: rest.projectId
        outputParameters:
        - type: object
          mapping: $.
      - method: PUT
        name: createdataset
        description: Create Dataset
        call: sanity-projects.createdataset
        with:
          projectId: rest.projectId
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/projects/{projectid}/tokens
      name: projects-projectid-tokens
      description: REST surface for projects-projectId-tokens.
      operations:
      - method: GET
        name: listtokens
        description: List Tokens
        call: sanity-projects.listtokens
        with:
          projectId: rest.projectId
        outputParameters:
        - type: object
          mapping: $.
      - method: POST
        name: createtoken
        description: Create Token
        call: sanity-projects.createtoken
        with:
          projectId: rest.projectId
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
  - type: mcp
    namespace: sanity-projects-mcp
    port: 9090
    transport: http
    description: MCP adapter for Sanity HTTP API — Projects. One tool per consumed operation, routed inline through this capability's
      consumes block.
    tools:
    - name: list-projects
      description: List Projects
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: sanity-projects.listprojects
      outputParameters:
      - type: object
        mapping: $.
    - name: create-project
      description: Create Project
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: sanity-projects.createproject
      with:
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: get-project
      description: Get Project
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: sanity-projects.getproject
      with:
        projectId: tools.projectId
      outputParameters:
      - type: object
        mapping: $.
    - name: update-project
      description: Update Project
      hints:
        readOnly: false
        destructive: false
        idempotent: true
      call: sanity-projects.updateproject
      with:
        projectId: tools.projectId
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: list-datasets
      description: List Datasets
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: sanity-projects.listdatasets
      with:
        projectId: tools.projectId
      outputParameters:
      - type: object
        mapping: $.
    - name: create-dataset
      description: Create Dataset
      hints:
        readOnly: false
        destructive: false
        idempotent: true
      call: sanity-projects.createdataset
      with:
        projectId: tools.projectId
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: list-tokens
      description: List Tokens
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: sanity-projects.listtokens
      with:
        projectId: tools.projectId
      outputParameters:
      - type: object
        mapping: $.
    - name: create-token
      description: Create Token
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: sanity-projects.createtoken
      with:
        projectId: tools.projectId
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.